]> git.lizzy.rs Git - rust.git/blob - tests/ui/mir/issue-74739.rs
Rollup merge of #106958 - jyn514:labels, r=m-ou-se
[rust.git] / tests / ui / mir / issue-74739.rs
1 // compile-flags: -O
2 // run-pass
3
4 struct Foo {
5     x: i32,
6 }
7
8 pub fn main() {
9     let mut foo = Foo { x: 42 };
10     let x = &mut foo.x;
11     *x = 13;
12     let y = foo;
13     assert_eq!(y.x, 13); // used to print 42 due to mir-opt bug
14 }