1
Fork 0

Rollup merge of #109901 - cjgillot:validate-debuginfo, r=b-naber

Enforce VarDebugInfo::Place in MIR validation.
This commit is contained in:
Michael Goulet 2023-04-04 09:27:44 -07:00 committed by GitHub
commit ed17b599df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 65 additions and 16 deletions

View file

@ -165,11 +165,15 @@ fn calculate_debuginfo_offset<
mir::ProjectionElem::Downcast(_, variant) => {
place = place.downcast(bx, variant);
}
_ => span_bug!(
var.source_info.span,
"unsupported var debuginfo place `{:?}`",
mir::Place { local, projection: var.projection },
),
_ => {
// Sanity check for `can_use_in_debuginfo`.
debug_assert!(!elem.can_use_in_debuginfo());
span_bug!(
var.source_info.span,
"unsupported var debuginfo place `{:?}`",
mir::Place { local, projection: var.projection },
)
}
}
}