fmt
This commit is contained in:
parent
743be666d4
commit
2d01258c12
1 changed files with 12 additions and 8 deletions
|
@ -2,17 +2,21 @@
|
||||||
use std::intrinsics::mir::*;
|
use std::intrinsics::mir::*;
|
||||||
|
|
||||||
#[repr(packed)]
|
#[repr(packed)]
|
||||||
struct S { field: [u32; 2] }
|
struct S {
|
||||||
|
field: [u32; 2],
|
||||||
|
}
|
||||||
|
|
||||||
#[custom_mir(dialect = "runtime", phase = "optimized")]
|
#[custom_mir(dialect = "runtime", phase = "optimized")]
|
||||||
fn test() { mir! {
|
fn test() {
|
||||||
let s: S;
|
mir! {
|
||||||
{
|
let s: S;
|
||||||
// Store a repeat expression directly into a field of a packed struct.
|
{
|
||||||
s.field = [0; 2];
|
// Store a repeat expression directly into a field of a packed struct.
|
||||||
Return()
|
s.field = [0; 2];
|
||||||
|
Return()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} }
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Run this a bunch of time to make sure it doesn't pass by chance.
|
// Run this a bunch of time to make sure it doesn't pass by chance.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue