diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-06-19 11:19:05 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-06-22 15:51:19 +0000 |
| commit | b0b4a0795949aee0df9bad292ba2951f8c6291ec (patch) | |
| tree | d99b525b06ab846cca5d3138a684cdcd84f379f4 | |
| parent | 0af4a211be2c9cc345728449a2fe213f64c216b8 (diff) | |
| download | rust-b0b4a0795949aee0df9bad292ba2951f8c6291ec.tar.gz rust-b0b4a0795949aee0df9bad292ba2951f8c6291ec.zip | |
ICE on types that should not be defining opaque types
| -rw-r--r-- | compiler/rustc_ty_utils/src/opaque_types.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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") + } } } |
