diff options
| author | Oli Scherer <github35764891676564198441@oli-obk.de> | 2021-08-20 16:31:14 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2021-12-03 15:23:43 +0000 |
| commit | 9e5939ad92ae1096e3945bbfdfe81ec515ed0c69 (patch) | |
| tree | 61b7061ff008dd601893d8f8b003ff023350b28d | |
| parent | d47a6cc3f2dab0ef046c2bb7b76a9ee8d1a0be92 (diff) | |
Remove a code path that is neither documented nor can I see the reason it existed.
Also, no tests fail when turning that arm into an ICE
| -rw-r--r-- | compiler/rustc_infer/src/infer/opaque_types.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/compiler/rustc_infer/src/infer/opaque_types.rs b/compiler/rustc_infer/src/infer/opaque_types.rs index 89c14bcc2ce..d9ab4ae1eda 100644 --- a/compiler/rustc_infer/src/infer/opaque_types.rs +++ b/compiler/rustc_infer/src/infer/opaque_types.rs @@ -461,10 +461,6 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> { if let Some(def_id) = def_id.as_local() { let opaque_hir_id = tcx.hir().local_def_id_to_hir_id(def_id); let parent_def_id = self.infcx.defining_use_anchor; - let def_scope_default = || { - let opaque_parent_hir_id = tcx.hir().get_parent_item(opaque_hir_id); - parent_def_id == tcx.hir().local_def_id(opaque_parent_hir_id) - }; let (in_definition_scope, origin) = match tcx.hir().expect_item(def_id).kind { // Anonymous `impl Trait` @@ -481,7 +477,14 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> { }) => { (may_define_opaque_type(tcx, parent_def_id, opaque_hir_id), origin) } - _ => (def_scope_default(), hir::OpaqueTyOrigin::TyAlias), + ref itemkind => { + span_bug!( + self.value_span, + "weird opaque type: {:#?}, {:#?}", + ty.kind(), + itemkind + ) + } }; if in_definition_scope { let opaque_type_key = |
