diff options
| author | Michael Goulet <michael@errs.io> | 2023-06-18 22:10:07 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-06-18 22:52:30 +0000 |
| commit | d43683f2e905d34ab289882c16124deb5ed09edd (patch) | |
| tree | 008304532296fbea7e97e6be2755df07eeba73a7 /compiler | |
| parent | 939786223f2d36b1af62e27e9a7a54bae6e30f3f (diff) | |
| download | rust-d43683f2e905d34ab289882c16124deb5ed09edd.tar.gz rust-d43683f2e905d34ab289882c16124deb5ed09edd.zip | |
Treat TAIT equation as always ambiguous in coherence
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_infer/src/infer/combine.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/compiler/rustc_infer/src/infer/combine.rs b/compiler/rustc_infer/src/infer/combine.rs index 152c56572b6..12cb86d7d72 100644 --- a/compiler/rustc_infer/src/infer/combine.rs +++ b/compiler/rustc_infer/src/infer/combine.rs @@ -124,13 +124,10 @@ impl<'tcx> InferCtxt<'tcx> { } // During coherence, opaque types should be treated as *possibly* - // equal to each other, even if their generic params differ, as - // they could resolve to the same hidden type, even for different - // generic params. - ( - &ty::Alias(ty::Opaque, ty::AliasTy { def_id: a_def_id, .. }), - &ty::Alias(ty::Opaque, ty::AliasTy { def_id: b_def_id, .. }), - ) if self.intercrate && a_def_id == b_def_id => { + // equal to any other type (except for possibly itself). This is an + // extremely heavy hammer, but can be relaxed in a fowards-compatible + // way later. + (&ty::Alias(ty::Opaque, _), _) | (_, &ty::Alias(ty::Opaque, _)) if self.intercrate => { relation.register_predicates([ty::Binder::dummy(ty::PredicateKind::Ambiguous)]); Ok(a) } |
