Don't ICE when computing a layout of a generator tainted by errors
This commit is contained in:
parent
a4f022e109
commit
5ea1d0e865
6 changed files with 50 additions and 8 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue