Introduce Operand::RuntimeChecks.

This commit is contained in:
Camille Gillot
2025-11-16 19:21:17 +00:00
parent 8e967a5a7b
commit f57b09d0f2
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -110,7 +110,7 @@ fn visit_terminator(&mut self, terminator: &mir::Terminator<'_>, _loc: mir::Loca
immutable_borrowers.push(p.local);
}
},
mir::Operand::Constant(..) => (),
mir::Operand::Constant(..) | mir::Operand::RuntimeChecks(..) => (),
}
}
@@ -151,7 +151,7 @@ fn rvalue_locals(rvalue: &mir::Rvalue<'_>, mut visit: impl FnMut(mir::Local)) {
let mut visit_op = |op: &mir::Operand<'_>| match op {
mir::Operand::Copy(p) | mir::Operand::Move(p) => visit(p.local),
mir::Operand::Constant(..) => (),
mir::Operand::Constant(..) | mir::Operand::RuntimeChecks(..) => (),
};
match rvalue {
+1
View File
@@ -277,6 +277,7 @@ fn check_operand<'tcx>(
Some(_) => Err((span, "cannot access `static` items in const fn".into())),
None => Ok(()),
},
Operand::RuntimeChecks(..) => Ok(()),
}
}