diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2021-01-15 18:26:16 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-15 18:26:16 +0900 |
| commit | ce06df2e4a1d2c8a1d092d39b589bb5d101b6c10 (patch) | |
| tree | cd26478c2ff94622721f566024dda1714c0f50ad /compiler/rustc_codegen_llvm | |
| parent | a584d874172b85d854f2e4d2a3256f7c23e3183a (diff) | |
| parent | 5ea1d0e865e3a15c054233198622b711ed0b5f86 (diff) | |
| download | rust-ce06df2e4a1d2c8a1d092d39b589bb5d101b6c10.tar.gz rust-ce06df2e4a1d2c8a1d092d39b589bb5d101b6c10.zip | |
Rollup merge of #81008 - tmiasko:generator-layout-err, r=tmandry
Don't ICE when computing a layout of a generator tainted by errors Fixes #80998.
Diffstat (limited to 'compiler/rustc_codegen_llvm')
| -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 { |
