mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
Introduce Operand::RuntimeChecks.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -277,6 +277,7 @@ fn check_operand<'tcx>(
|
||||
Some(_) => Err((span, "cannot access `static` items in const fn".into())),
|
||||
None => Ok(()),
|
||||
},
|
||||
Operand::RuntimeChecks(..) => Ok(()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user