Allow defining opaque types during trait object upcasting.

No stable code is affected, as this requires the `trait_upcasting` feature gate.
This commit is contained in:
Oli Scherer 2024-04-17 10:01:34 +00:00
parent 29a630eb72
commit 7f292f41a0
3 changed files with 3 additions and 20 deletions

View file

@ -2631,7 +2631,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
nested.extend(
self.infcx
.at(&obligation.cause, obligation.param_env)
.eq(DefineOpaqueTypes::No, source_projection, target_projection)
.eq(DefineOpaqueTypes::Yes, source_projection, target_projection)
.map_err(|_| SelectionError::Unimplemented)?
.into_obligations(),
);