]> git.lizzy.rs Git - rust.git/blob - src/test/ui/E0506.rs
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[rust.git] / src / test / ui / E0506.rs
1 // revisions: ast mir
2 //[mir]compile-flags: -Z borrowck=mir
3
4 struct FancyNum {
5     num: u8,
6 }
7
8 fn main() {
9     let mut fancy_num = FancyNum { num: 5 };
10     let fancy_ref = &fancy_num;
11     fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
12                                      //[mir]~^ ERROR [E0506]
13
14     println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
15 }