Auto merge of #118791 - saethlin:use-immediate-type, r=nikic · rust-lang/rust@7e452c1 (original) (raw)
File tree
2 files changed
lines changed
- compiler/rustc_codegen_ssa/src/mir
2 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -155,7 +155,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> { | ||
155 | 155 | Abi::Scalar(s @ abi::Scalar::Initialized { .. }) => { |
156 | 156 | let size = s.size(bx); |
157 | 157 | assert_eq!(size, layout.size, "abi::Scalar size does not match layout size"); |
158 | -let val = read_scalar(offset, size, s, bx.backend_type(layout)); | |
158 | +let val = read_scalar(offset, size, s, bx.immediate_backend_type(layout)); | |
159 | 159 | OperandRef { val: OperandValue::Immediate(val), layout } |
160 | 160 | } |
161 | 161 | Abi::ScalarPair( |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
1 | +// This is a regression test for https://github.com/rust-lang/rust/issues/118047 | |
2 | +// build-pass | |
3 | +// compile-flags: -Zmir-opt-level=0 -Zmir-enable-passes=+DataflowConstProp | |
4 | + | |
5 | +#![crate_type = "lib"] | |
6 | + | |
7 | +pub struct State { | |
8 | +inner: bool | |
9 | +} | |
10 | + | |
11 | +pub fn make() -> State { | |
12 | +State { | |
13 | +inner: true | |
14 | +} | |
15 | +} |