diff options
| author | Michael Goulet <michael@errs.io> | 2023-06-23 21:50:44 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-06-27 21:36:15 +0000 |
| commit | 75a8f681837c70051e0200a14f58ae07dbe58e66 (patch) | |
| tree | e70311961254c5dde0c2d7cf451d832f6c10260c | |
| parent | 983f6b97872d4dc2b7aaf2f9b088d433904e2f0e (diff) | |
| download | rust-75a8f681837c70051e0200a14f58ae07dbe58e66.tar.gz rust-75a8f681837c70051e0200a14f58ae07dbe58e66.zip | |
Remove unnecessary DefineOpaqueTypes::Bubble from codegen
| -rw-r--r-- | compiler/rustc_traits/src/codegen.rs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/compiler/rustc_traits/src/codegen.rs b/compiler/rustc_traits/src/codegen.rs index 5f84acc8a04..ef50fa23caf 100644 --- a/compiler/rustc_traits/src/codegen.rs +++ b/compiler/rustc_traits/src/codegen.rs @@ -5,7 +5,7 @@ use rustc_infer::infer::TyCtxtInferExt; use rustc_infer::traits::{FulfillmentErrorCode, TraitEngineExt as _}; -use rustc_middle::traits::{CodegenObligationError, DefiningAnchor}; +use rustc_middle::traits::CodegenObligationError; use rustc_middle::ty::{self, TyCtxt}; use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt; use rustc_trait_selection::traits::{ @@ -29,13 +29,7 @@ pub fn codegen_select_candidate<'tcx>( // Do the initial selection for the obligation. This yields the // shallow result we are looking for -- that is, what specific impl. - let infcx = tcx - .infer_ctxt() - .ignoring_regions() - .with_opaque_type_inference(DefiningAnchor::Bubble) - .build(); - //~^ HACK `Bubble` is required for - // this test to pass: type-alias-impl-trait/assoc-projection-ice.rs + let infcx = tcx.infer_ctxt().ignoring_regions().build(); let mut selcx = SelectionContext::new(&infcx); let obligation_cause = ObligationCause::dummy(); @@ -79,10 +73,5 @@ pub fn codegen_select_candidate<'tcx>( let impl_source = infcx.resolve_vars_if_possible(impl_source); let impl_source = infcx.tcx.erase_regions(impl_source); - // Opaque types may have gotten their hidden types constrained, but we can ignore them safely - // as they will get constrained elsewhere, too. - // (ouz-a) This is required for `type-alias-impl-trait/assoc-projection-ice.rs` to pass - let _ = infcx.take_opaque_types(); - Ok(&*tcx.arena.alloc(impl_source)) } |
