diff --git a/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs b/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs index 038168ca638b4..10721bdaa636c 100644 --- a/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs +++ b/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs @@ -1273,16 +1273,22 @@ where return ControlFlow::Break(Err(NoSolution)); }; - if let ty::Placeholder(p) = ty.kind() { - if p.universe() == ty::UniverseIndex::ROOT { - ControlFlow::Break(Ok(())) - } else { - ControlFlow::Continue(()) + match ty.kind() { + ty::Placeholder(p) => { + if p.universe() == ty::UniverseIndex::ROOT { + ControlFlow::Break(Ok(())) + } else { + ControlFlow::Continue(()) + } } - } else if ty.has_type_flags(TypeFlags::HAS_PLACEHOLDER | TypeFlags::HAS_RE_INFER) { - ty.super_visit_with(self) - } else { - ControlFlow::Continue(()) + ty::Infer(_) => ControlFlow::Break(Ok(())), + _ if ty.has_type_flags( + TypeFlags::HAS_PLACEHOLDER | TypeFlags::HAS_INFER | TypeFlags::HAS_ALIAS, + ) => + { + ty.super_visit_with(self) + } + _ => ControlFlow::Continue(()), } } @@ -1292,16 +1298,22 @@ where return ControlFlow::Break(Err(NoSolution)); }; - if let ty::ConstKind::Placeholder(p) = ct.kind() { - if p.universe() == ty::UniverseIndex::ROOT { - ControlFlow::Break(Ok(())) - } else { - ControlFlow::Continue(()) + match ct.kind() { + ty::ConstKind::Placeholder(p) => { + if p.universe() == ty::UniverseIndex::ROOT { + ControlFlow::Break(Ok(())) + } else { + ControlFlow::Continue(()) + } } - } else if ct.has_type_flags(TypeFlags::HAS_PLACEHOLDER | TypeFlags::HAS_RE_INFER) { - ct.super_visit_with(self) - } else { - ControlFlow::Continue(()) + ty::ConstKind::Infer(_) => ControlFlow::Break(Ok(())), + _ if ct.has_type_flags( + TypeFlags::HAS_PLACEHOLDER | TypeFlags::HAS_INFER | TypeFlags::HAS_ALIAS, + ) => + { + ct.super_visit_with(self) + } + _ => ControlFlow::Continue(()), } } diff --git a/tests/ui/traits/next-solver/normalize/normalize-param-env-4.next.stderr b/tests/ui/traits/next-solver/normalize/normalize-param-env-4.next.stderr index f5fd9ce9864ce..e91a48f62aec3 100644 --- a/tests/ui/traits/next-solver/normalize/normalize-param-env-4.next.stderr +++ b/tests/ui/traits/next-solver/normalize/normalize-param-env-4.next.stderr @@ -4,6 +4,24 @@ error[E0275]: overflow evaluating the requirement `::Assoc: Trait` LL | ::Assoc: Trait, | ^^^^^ -error: aborting due to 1 previous error +error[E0275]: overflow evaluating the requirement `::Assoc well-formed` + --> $DIR/normalize-param-env-4.rs:19:26 + | +LL | ::Assoc: Trait, + | ^^^^^ + +error[E0275]: overflow evaluating the requirement `T: Trait` + --> $DIR/normalize-param-env-4.rs:32:19 + | +LL | impls_trait::(); + | ^ + | +note: required by a bound in `impls_trait` + --> $DIR/normalize-param-env-4.rs:15:19 + | +LL | fn impls_trait() {} + | ^^^^^ required by this bound in `impls_trait` + +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0275`.