1
Fork 0

Enforce VarDebugInfo::Place in MIR validation.

This commit is contained in:
Camille GILLOT 2023-01-14 22:23:49 +00:00
parent 8679208664
commit a84909c1e7
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 },
)
}
}
}