Skip to content

Commit 9d41e8f

Browse files
committed
(try to) fix cranelift
1 parent 5e52b61 commit 9d41e8f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/constant.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
use rustc_span::DUMMY_SP;
44

5+
use rustc_ast::Mutability;
56
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
67
use rustc_errors::ErrorReported;
78
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
@@ -175,6 +176,7 @@ pub(crate) fn codegen_const_value<'tcx>(
175176
let mut alloc = Allocation::from_bytes(
176177
std::iter::repeat(0).take(size.bytes_usize()).collect::<Vec<u8>>(),
177178
align,
179+
Mutability::Not,
178180
);
179181
alloc.write_scalar(fx, alloc_range(Size::ZERO, size), x.into()).unwrap();
180182
let alloc = fx.tcx.intern_const_alloc(alloc);

0 commit comments

Comments
 (0)