Skip to content

Commit b0b4a07

Browse files
committed
ICE on types that should not be defining opaque types
1 parent 0af4a21 commit b0b4a07

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc_ty_utils/src/opaque_types.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ fn opaque_types_defined_by<'tcx>(tcx: TyCtxt<'tcx>, item: LocalDefId) -> &'tcx [
217217
| DefKind::GlobalAsm
218218
| DefKind::Impl { .. }
219219
| DefKind::Closure
220-
| DefKind::Generator => &[],
220+
| DefKind::Generator => {
221+
span_bug!(tcx.def_span(item), "{kind:?} is type checked as part of its parent")
222+
}
221223
}
222224
}
223225

0 commit comments

Comments
 (0)