Skip to content

Commit 7e796ff

Browse files
authored
Rollup merge of rust-lang#91493 - oli-obk:cleanup, r=michaelwoerister
Remove a dead code path. It is neither documented nor can I see any way it could ever be reached. Also, no tests fail when turning that arm into an ICE
2 parents 2309e7d + 9e5939a commit 7e796ff

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

compiler/rustc_infer/src/infer/opaque_types.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -461,10 +461,6 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
461461
if let Some(def_id) = def_id.as_local() {
462462
let opaque_hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
463463
let parent_def_id = self.infcx.defining_use_anchor;
464-
let def_scope_default = || {
465-
let opaque_parent_hir_id = tcx.hir().get_parent_item(opaque_hir_id);
466-
parent_def_id == tcx.hir().local_def_id(opaque_parent_hir_id)
467-
};
468464
let (in_definition_scope, origin) = match tcx.hir().expect_item(def_id).kind
469465
{
470466
// Anonymous `impl Trait`
@@ -481,7 +477,14 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
481477
}) => {
482478
(may_define_opaque_type(tcx, parent_def_id, opaque_hir_id), origin)
483479
}
484-
_ => (def_scope_default(), hir::OpaqueTyOrigin::TyAlias),
480+
ref itemkind => {
481+
span_bug!(
482+
self.value_span,
483+
"weird opaque type: {:#?}, {:#?}",
484+
ty.kind(),
485+
itemkind
486+
)
487+
}
485488
};
486489
if in_definition_scope {
487490
let opaque_type_key =

0 commit comments

Comments
 (0)