ctfe, const_to_op only for mir constants

This commit is contained in:
lcnr 2022-09-19 16:17:33 +02:00
parent 638b612154
commit 526856768d
6 changed files with 40 additions and 49 deletions

View file

@ -471,7 +471,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
return None;
}
self.ecx.mir_const_to_op(&c.literal, None).ok()
self.ecx.const_to_op(&c.literal, None).ok()
}
/// Returns the value, if any, of evaluating `place`.

View file

@ -292,7 +292,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
return None;
}
match self.ecx.mir_const_to_op(&c.literal, None) {
match self.ecx.const_to_op(&c.literal, None) {
Ok(op) => Some(op),
Err(error) => {
let tcx = self.ecx.tcx.at(c.span);