]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | // Ensure that moves out of static items is forbidden |
2 | ||
223e47cc | 3 | struct Foo { |
1a4d82fc | 4 | foo: isize, |
223e47cc LB |
5 | } |
6 | ||
e9174d1e | 7 | static BAR: Foo = Foo { foo: 5 }; |
1a4d82fc JJ |
8 | |
9 | ||
10 | fn test(f: Foo) { | |
11 | let _f = Foo{foo: 4, ..f}; | |
12 | } | |
223e47cc LB |
13 | |
14 | fn main() { | |
dc9dc135 | 15 | test(BAR); //~ ERROR cannot move out of static item `BAR` [E0507] |
223e47cc | 16 | } |