From b0b4a0795949aee0df9bad292ba2951f8c6291ec Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 19 Jun 2023 11:19:05 +0000 Subject: [PATCH] ICE on types that should not be defining opaque types --- compiler/rustc_ty_utils/src/opaque_types.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_ty_utils/src/opaque_types.rs b/compiler/rustc_ty_utils/src/opaque_types.rs index 498194a7c10..b8dfff0b8ab 100644 --- a/compiler/rustc_ty_utils/src/opaque_types.rs +++ b/compiler/rustc_ty_utils/src/opaque_types.rs @@ -217,7 +217,9 @@ fn opaque_types_defined_by<'tcx>(tcx: TyCtxt<'tcx>, item: LocalDefId) -> &'tcx [ | DefKind::GlobalAsm | DefKind::Impl { .. } | DefKind::Closure - | DefKind::Generator => &[], + | DefKind::Generator => { + span_bug!(tcx.def_span(item), "{kind:?} is type checked as part of its parent") + } } }