Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
// FIXME(generic_const_exprs): Revisit this before stabilization.
// See also `tests/ui/const-generics/generic_const_exprs/type-alias-bounds.rs`.
let ty = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip();
if ty.has_type_flags(ty::TypeFlags::HAS_CT_PROJECTION)
if ty.has_type_flags(ty::TypeFlags::HAS_CONST_ALIASES)
&& cx.tcx.features().generic_const_exprs()
{
return;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/abstract_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl<'tcx> TyCtxt<'tcx> {
self.tcx
}
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
if ty.has_type_flags(ty::TypeFlags::HAS_CT_PROJECTION) {
if ty.has_type_flags(ty::TypeFlags::HAS_CONST_ALIASES) {
ty.super_fold_with(self)
} else {
ty
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/impossible_predicates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub(crate) fn has_impossible_predicates(tcx: TyCtxt<'_>, def_id: DefId) -> bool
// Only consider global clauses to simplify.
TypeFlags::HAS_FREE_LOCAL_NAMES
// Clauses that refer to alias constants as they cause cycles.
| TypeFlags::HAS_CT_PROJECTION,
| TypeFlags::HAS_CONST_ALIASES,
)
});
let predicates: Vec<_> = traits::elaborate(tcx, predicates).collect();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ impl<'a, 'tcx> QueryNormalizer<'a, 'tcx> {
// of type/const and we need to continue folding it to reveal the TAIT behind it
// or further normalize nested alias consts.
if res != term.to_term(tcx, ty::IsRigid::No)
&& (res.has_type_flags(ty::TypeFlags::HAS_CT_PROJECTION)
&& (res.has_type_flags(ty::TypeFlags::HAS_CONST_ALIASES)
|| matches!(
term.kind,
ty::AliasTermKind::FreeTy { .. } | ty::AliasTermKind::FreeConst { .. }
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_type_ir/src/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ bitflags::bitflags! {
/// Does this have `Inherent`?
const HAS_TY_INHERENT = 1 << 13;
/// Does this have `ConstKind::Alias`?
const HAS_CT_PROJECTION = 1 << 14;
const HAS_CONST_ALIASES = 1 << 14;

/// Does this have `Alias` or `ConstKind::Alias`?
///
Expand All @@ -89,7 +89,7 @@ bitflags::bitflags! {
| TypeFlags::HAS_TY_FREE_ALIAS.bits()
| TypeFlags::HAS_TY_OPAQUE.bits()
| TypeFlags::HAS_TY_INHERENT.bits()
| TypeFlags::HAS_CT_PROJECTION.bits();
| TypeFlags::HAS_CONST_ALIASES.bits();

/// Is a type or const error reachable?
const HAS_NON_REGION_ERROR = 1 << 15;
Expand Down Expand Up @@ -480,7 +480,7 @@ impl<I: Interner> FlagComputation<I> {
ty::ConstKind::Alias(is_rigid, alias_const) => {
self.add_is_rigid(is_rigid);
self.add_args(alias_const.args.as_slice());
self.add_flags(TypeFlags::HAS_CT_PROJECTION);
self.add_flags(TypeFlags::HAS_CONST_ALIASES);
}
ty::ConstKind::Infer(infer) => match infer {
ty::InferConst::Fresh(_) => self.add_flags(TypeFlags::HAS_CT_FRESH),
Expand Down
Loading