Skip to content

Commit 602b0ef

Browse files
committed
Define opaque types everywhere in confirmation.
Confirmation is only applied to things that selection already considered equal. If an opaque type were to be compared with another type, we'd already have errored out in selection.
1 parent 6c6b302 commit 602b0ef

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

compiler/rustc_trait_selection/src/traits/select/confirmation.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
197197
obligations.extend(
198198
self.infcx
199199
.at(&obligation.cause, obligation.param_env)
200-
.eq(DefineOpaqueTypes::No, placeholder_trait_predicate, candidate)
200+
.eq(DefineOpaqueTypes::Yes, placeholder_trait_predicate, candidate)
201201
.map(|InferOk { obligations, .. }| obligations)
202202
.map_err(|_| Unimplemented)?,
203203
);
@@ -568,7 +568,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
568568
nested.extend(
569569
self.infcx
570570
.at(&obligation.cause, obligation.param_env)
571-
.eq(DefineOpaqueTypes::No, trait_predicate.trait_ref, upcast_trait_ref)
571+
.eq(DefineOpaqueTypes::Yes, trait_predicate.trait_ref, upcast_trait_ref)
572572
.map(|InferOk { obligations, .. }| obligations)
573573
.map_err(|_| Unimplemented)?,
574574
);
@@ -1195,7 +1195,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
11951195
let InferOk { mut obligations, .. } = self
11961196
.infcx
11971197
.at(&obligation.cause, obligation.param_env)
1198-
.sup(DefineOpaqueTypes::No, target, source_trait)
1198+
.sup(DefineOpaqueTypes::Yes, target, source_trait)
11991199
.map_err(|_| Unimplemented)?;
12001200

12011201
// Register one obligation for 'a: 'b.
@@ -1263,7 +1263,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
12631263
let InferOk { obligations, .. } = self
12641264
.infcx
12651265
.at(&obligation.cause, obligation.param_env)
1266-
.eq(DefineOpaqueTypes::No, b, a)
1266+
.eq(DefineOpaqueTypes::Yes, b, a)
12671267
.map_err(|_| Unimplemented)?;
12681268

12691269
ImplSource::Builtin(BuiltinImplSource::Misc, obligations)
@@ -1311,7 +1311,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
13111311
let InferOk { obligations, .. } = self
13121312
.infcx
13131313
.at(&obligation.cause, obligation.param_env)
1314-
.eq(DefineOpaqueTypes::No, target, new_struct)
1314+
.eq(DefineOpaqueTypes::Yes, target, new_struct)
13151315
.map_err(|_| Unimplemented)?;
13161316
nested.extend(obligations);
13171317

@@ -1344,7 +1344,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
13441344
let InferOk { mut obligations, .. } = self
13451345
.infcx
13461346
.at(&obligation.cause, obligation.param_env)
1347-
.eq(DefineOpaqueTypes::No, target, new_tuple)
1347+
.eq(DefineOpaqueTypes::Yes, target, new_tuple)
13481348
.map_err(|_| Unimplemented)?;
13491349

13501350
// Add a nested `T: Unsize<U>` predicate.

0 commit comments

Comments
 (0)