fn get_const(&self, local: Local) -> Option<OpTy<'tcx>> {
let op = self.ecx.access_local(self.ecx.frame(), local, None).ok();
- if local == RETURN_PLACE {
- // Try to read the return place 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.
- return match op.map(|ret| self.ecx.try_read_immediate(ret)) {
- Some(Ok(Ok(imm))) => Some(imm.into()),
- _ => op,
- };
+ // 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.
+ match op.map(|ret| self.ecx.try_read_immediate(ret)) {
+ Some(Ok(Ok(imm))) => Some(imm.into()),
+ _ => op,
}
-
- op
}
fn remove_const(&mut self, local: Local) {
// Change constructor path (C-like) --------------------------------------
#[cfg(cfail1)]
pub fn change_constructor_path_c_like() {
- let _ = Clike::B;
+ let _x = Clike::B;
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,mir_built,typeck_tables_of")]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_path_c_like() {
- let _ = Clike2::B;
+ let _x = Clike2::B;
}
// Change constructor variant (C-like) --------------------------------------
#[cfg(cfail1)]
pub fn change_constructor_variant_c_like() {
- let _ = Clike::A;
+ let _x = Clike::A;
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_constructor_variant_c_like() {
- let _ = Clike::C;
+ let _x = Clike::C;
}