Rollup merge of #112546 - lcnr:opaque-type-cleanup, r=compiler-errors

new solver: extend assert to other aliases
This commit is contained in:
Matthias Krüger 2023-06-12 17:44:39 +02:00 committed by GitHub
commit 9cb785b9d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -34,7 +34,7 @@ use rustc_middle::infer::unify_key::{ConstVarValue, ConstVariableValue};
use rustc_middle::infer::unify_key::{ConstVariableOrigin, ConstVariableOriginKind};
use rustc_middle::ty::error::{ExpectedFound, TypeError};
use rustc_middle::ty::relate::{RelateResult, TypeRelation};
use rustc_middle::ty::{self, AliasKind, InferConst, ToPredicate, Ty, TyCtxt, TypeVisitableExt};
use rustc_middle::ty::{self, InferConst, ToPredicate, Ty, TyCtxt, TypeVisitableExt};
use rustc_middle::ty::{IntType, UintType};
use rustc_span::DUMMY_SP;
@ -103,12 +103,12 @@ impl<'tcx> InferCtxt<'tcx> {
// We don't expect `TyVar` or `Fresh*` vars at this point with lazy norm.
(
ty::Alias(AliasKind::Projection, _),
ty::Alias(..),
ty::Infer(ty::TyVar(_) | ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_)),
)
| (
ty::Infer(ty::TyVar(_) | ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_)),
ty::Alias(AliasKind::Projection, _),
ty::Alias(..),
) if self.next_trait_solver() => {
bug!()
}

View File

@ -320,7 +320,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
candidates
}
/// If the self type of a goal is a projection, computing the relevant candidates is difficult.
/// If the self type of a goal is an alias, computing the relevant candidates is difficult.
///
/// To deal with this, we first try to normalize the self type and add the candidates for the normalized
/// self type to the list of candidates in case that succeeds. We also have to consider candidates with the