diff options
| author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2021-01-14 00:00:00 +0000 |
|---|---|---|
| committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2021-01-14 13:13:13 +0100 |
| commit | 5ea1d0e865e3a15c054233198622b711ed0b5f86 (patch) | |
| tree | d9c4f5a777b7ba50a9aa3568ae98f896fafdb489 /compiler/rustc_codegen_llvm/src | |
| parent | a4f022e1099c712fdcc8555fd10caccb1a631877 (diff) | |
| download | rust-5ea1d0e865e3a15c054233198622b711ed0b5f86.tar.gz rust-5ea1d0e865e3a15c054233198622b711ed0b5f86.zip | |
Don't ICE when computing a layout of a generator tainted by errors
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs index 36a21b38c03..b9ae7963250 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs @@ -1832,8 +1832,9 @@ impl<'tcx> VariantInfo<'_, 'tcx> { fn source_info(&self, cx: &CodegenCx<'ll, 'tcx>) -> Option<SourceInfo<'ll>> { match self { VariantInfo::Generator { def_id, variant_index, .. } => { - let span = - cx.tcx.generator_layout(*def_id).variant_source_info[*variant_index].span; + let span = cx.tcx.generator_layout(*def_id).unwrap().variant_source_info + [*variant_index] + .span; if !span.is_dummy() { let loc = cx.lookup_debug_loc(span.lo()); return Some(SourceInfo { |
