Avoid fetching the opaque type origin when only "is this in the defining scope" is actually needed
This commit is contained in:
parent
ba5f0418af
commit
7cfa521931
5 changed files with 16 additions and 27 deletions
|
@ -155,10 +155,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
|
|||
if let ty::Alias(ty::Opaque, opaque_ty) = goal.predicate.self_ty().kind() {
|
||||
if matches!(goal.param_env.reveal(), Reveal::All)
|
||||
|| matches!(ecx.solver_mode(), SolverMode::Coherence)
|
||||
|| opaque_ty
|
||||
.def_id
|
||||
.as_local()
|
||||
.is_some_and(|def_id| ecx.can_define_opaque_ty(def_id))
|
||||
|| ecx.can_define_opaque_ty(opaque_ty.def_id)
|
||||
{
|
||||
return Err(NoSolution);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue