From e47d6c7a6b643e836455d4ebf5e7fb1eaad5c870 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 5 May 2022 09:55:38 +0200 Subject: give it a scary name --- compiler/rustc_mir_transform/src/const_prop.rs | 6 +++--- compiler/rustc_mir_transform/src/const_prop_lint.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/rustc_mir_transform/src') diff --git a/compiler/rustc_mir_transform/src/const_prop.rs b/compiler/rustc_mir_transform/src/const_prop.rs index 3fdfa53289b..f7535d338da 100644 --- a/compiler/rustc_mir_transform/src/const_prop.rs +++ b/compiler/rustc_mir_transform/src/const_prop.rs @@ -415,7 +415,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> { // Try to read the local as an immediate so that if it is representable as a scalar, we can // handle it as such, but otherwise, just return the value as is. - Some(match self.ecx.try_read_immediate(&op, /*force*/ false) { + Some(match self.ecx.read_immediate_raw(&op, /*force*/ false) { Ok(Ok(imm)) => imm.into(), _ => op, }) @@ -709,8 +709,8 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> { return; } - // FIXME> figure out what to do when try_read_immediate fails - let imm = self.use_ecx(|this| this.ecx.try_read_immediate(value, /*force*/ false)); + // FIXME> figure out what to do when read_immediate_raw fails + let imm = self.use_ecx(|this| this.ecx.read_immediate_raw(value, /*force*/ false)); if let Some(Ok(imm)) = imm { match *imm { diff --git a/compiler/rustc_mir_transform/src/const_prop_lint.rs b/compiler/rustc_mir_transform/src/const_prop_lint.rs index 2bc27873ac1..aa898cfd3ba 100644 --- a/compiler/rustc_mir_transform/src/const_prop_lint.rs +++ b/compiler/rustc_mir_transform/src/const_prop_lint.rs @@ -412,7 +412,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> { // Try to read the local as an immediate so that if it is representable as a scalar, we can // handle it as such, but otherwise, just return the value as is. - Some(match self.ecx.try_read_immediate(&op, /*force*/ false) { + Some(match self.ecx.read_immediate_raw(&op, /*force*/ false) { Ok(Ok(imm)) => imm.into(), _ => op, }) -- cgit 1.4.1-3-g733a5