Auto merge of #114331 - matthiaskrgr:rollup-rnrmwcx, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #100455 (Implement RefUnwindSafe for Backtrace) - #113428 (coverage: Replace `ExpressionOperandId` with enum `Operand`) - #114283 (Use parking lot's rwlock even without parallel-rustc) - #114288 (Improve diagnostic for wrong borrow on binary operations) - #114296 (interpret: fix alignment handling for Repeat expressions) - #114306 ([rustc_data_structures][perf] Simplify base_n::push_str.) - #114320 (Cover statements for stable_mir) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
4896daa398
30 changed files with 816 additions and 327 deletions
22
src/tools/miri/tests/pass/align_repeat_into_packed_field.rs
Normal file
22
src/tools/miri/tests/pass/align_repeat_into_packed_field.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#![feature(custom_mir, core_intrinsics)]
|
||||
use std::intrinsics::mir::*;
|
||||
|
||||
#[repr(packed)]
|
||||
struct S { field: [u32; 2] }
|
||||
|
||||
#[custom_mir(dialect = "runtime", phase = "optimized")]
|
||||
fn test() { mir! {
|
||||
let s: S;
|
||||
{
|
||||
// Store a repeat expression directly into a field of a packed struct.
|
||||
s.field = [0; 2];
|
||||
Return()
|
||||
}
|
||||
} }
|
||||
|
||||
fn main() {
|
||||
// Run this a bunch of time to make sure it doesn't pass by chance.
|
||||
for _ in 0..20 {
|
||||
test();
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,8 @@ use std::mem::size_of;
|
|||
|
||||
fn main() {
|
||||
let mut a = Params::new();
|
||||
// The array itself here happens to be quite well-aligned, but not all its elements have that
|
||||
// large alignment and we better make sure that is still accepted by Miri.
|
||||
a.key_block = [0; BLOCKBYTES];
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue