diff options
| author | Ralf Jung <post@ralfj.de> | 2021-05-23 12:44:05 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2021-05-23 12:44:05 +0200 |
| commit | 461b2f83f3671811f364f16b881a614c057f0a6e (patch) | |
| tree | 9d9301ccd7889d16712e901793da69dfb47563d9 /compiler/rustc_codegen_cranelift | |
| parent | 585141b219e18f7c4c5817347241f597b59035a5 (diff) | |
| download | rust-461b2f83f3671811f364f16b881a614c057f0a6e.tar.gz rust-461b2f83f3671811f364f16b881a614c057f0a6e.zip | |
(try to) fix cranelift
Diffstat (limited to 'compiler/rustc_codegen_cranelift')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/constant.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/constant.rs b/compiler/rustc_codegen_cranelift/src/constant.rs index c0f2920652f..6b132e4ff0f 100644 --- a/compiler/rustc_codegen_cranelift/src/constant.rs +++ b/compiler/rustc_codegen_cranelift/src/constant.rs @@ -2,6 +2,7 @@ use rustc_span::DUMMY_SP; +use rustc_ast::Mutability; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_errors::ErrorReported; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; @@ -175,6 +176,7 @@ pub(crate) fn codegen_const_value<'tcx>( let mut alloc = Allocation::from_bytes( std::iter::repeat(0).take(size.bytes_usize()).collect::<Vec<u8>>(), align, + Mutability::Not, ); alloc.write_scalar(fx, alloc_range(Size::ZERO, size), x.into()).unwrap(); let alloc = fx.tcx.intern_const_alloc(alloc); |
