diff options
| author | Michael Goulet <michael@errs.io> | 2024-09-25 19:19:22 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-09-26 22:26:29 -0400 |
| commit | d4ee408afc59b36ff59b6fd12d47c1beeba8e985 (patch) | |
| tree | 60206518d97d23b8b2da5dd6f7992b5c30f99db5 /compiler/rustc_trait_selection/src | |
| parent | 58420a065b68ecb3eec03b942740c761cdadd5c4 (diff) | |
| download | rust-d4ee408afc59b36ff59b6fd12d47c1beeba8e985.tar.gz rust-d4ee408afc59b36ff59b6fd12d47c1beeba8e985.zip | |
Check allow instantiating object trait binder when upcasting and in new solver
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/select/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index cbc17a058f6..2922a4898e9 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -2582,12 +2582,12 @@ impl<'tcx> SelectionContext<'_, 'tcx> { nested.extend( self.infcx .at(&obligation.cause, obligation.param_env) - .eq( + .sup( DefineOpaqueTypes::Yes, + bound.rebind(target_principal), upcast_principal.map_bound(|trait_ref| { ty::ExistentialTraitRef::erase_self_ty(tcx, trait_ref) }), - bound.rebind(target_principal), ) .map_err(|_| SelectionError::Unimplemented)? .into_obligations(), @@ -2620,7 +2620,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> { nested.extend( self.infcx .at(&obligation.cause, obligation.param_env) - .eq(DefineOpaqueTypes::Yes, source_projection, target_projection) + .sup(DefineOpaqueTypes::Yes, target_projection, source_projection) .map_err(|_| SelectionError::Unimplemented)? .into_obligations(), ); |
