]> git.lizzy.rs Git - rust.git/blob - src/test/ui/static/static-items-cant-move.rs
Rollup merge of #102977 - lukas-code:is-sorted-hrtb, r=m-ou-se
[rust.git] / src / test / ui / static / static-items-cant-move.rs
1 // Verifies that static items can't be moved
2
3 struct B;
4
5 struct Foo {
6     foo: isize,
7     b: B,
8 }
9
10 static BAR: Foo = Foo { foo: 5, b: B };
11
12
13 fn test(f: Foo) {
14     let _f = Foo{foo: 4, ..f};
15 }
16
17 fn main() {
18     test(BAR); //~ ERROR cannot move out of static item
19 }