Normalize passes keep spans and clean warnings
This commit is contained in:
@ -41,8 +41,8 @@ fn analyze_function(func: &MirFunction) -> EscapeInfo {
|
||||
let mut info = EscapeInfo::default();
|
||||
// Collect local boxes: results of NewBox in this function
|
||||
for block in func.blocks.values() {
|
||||
for ins in block.instructions.iter() {
|
||||
if let MirInstruction::NewBox { dst, .. } = ins {
|
||||
for sp in block.iter_spanned() {
|
||||
if let MirInstruction::NewBox { dst, .. } = sp.inst {
|
||||
info.local_boxes.insert(*dst);
|
||||
}
|
||||
}
|
||||
@ -54,8 +54,8 @@ fn analyze_function(func: &MirFunction) -> EscapeInfo {
|
||||
}
|
||||
// Conservative escape marking
|
||||
for block in func.blocks.values() {
|
||||
for ins in block.all_instructions() {
|
||||
match ins {
|
||||
for sp in block.all_spanned_instructions() {
|
||||
match sp.inst {
|
||||
MirInstruction::Return { value: Some(v) } => {
|
||||
if info.local_boxes.contains(v) {
|
||||
info.escaping.insert(*v);
|
||||
|
||||
Reference in New Issue
Block a user