diff options
| author | Michael Goulet <michael@errs.io> | 2022-07-16 18:35:56 -0700 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-07-16 18:36:08 -0700 |
| commit | 23cb89ea3810bf63a70b9e7b473c046457982179 (patch) | |
| tree | 4b755ee972b540faa7ab7662b723edc942cf4437 /compiler | |
| parent | d5e7f4782e4b699728d0a08200ecd1a54d56a85d (diff) | |
| download | rust-23cb89ea3810bf63a70b9e7b473c046457982179.tar.gz rust-23cb89ea3810bf63a70b9e7b473c046457982179.zip | |
Do not constraint TAITs when checking impl/trait item compatibility
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_typeck/src/check/compare_method.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/rustc_typeck/src/check/compare_method.rs b/compiler/rustc_typeck/src/check/compare_method.rs index a53217ef818..6ae17fc6176 100644 --- a/compiler/rustc_typeck/src/check/compare_method.rs +++ b/compiler/rustc_typeck/src/check/compare_method.rs @@ -1505,6 +1505,21 @@ pub fn check_type_bounds<'tcx>( &outlives_environment, ); + let constraints = infcx.inner.borrow_mut().opaque_type_storage.take_opaque_types(); + for (key, value) in constraints { + infcx + .report_mismatched_types( + &ObligationCause::misc( + value.hidden_type.span, + tcx.hir().local_def_id_to_hir_id(impl_ty.def_id.expect_local()), + ), + tcx.mk_opaque(key.def_id, key.substs), + value.hidden_type.ty, + TypeError::Mismatch, + ) + .emit(); + } + Ok(()) }) } |
