]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/2229_closure_analysis/diagnostics/closure-origin-struct-diagnostics.rs
Auto merge of #106227 - bryangarza:ctfe-limit, r=oli-obk
[rust.git] / tests / ui / closures / 2229_closure_analysis / diagnostics / closure-origin-struct-diagnostics.rs
1 // edition:2021
2
3 // Check that precise paths are being reported back in the error message.
4
5 struct Y {
6     y: X
7 }
8
9 struct X {
10     a: u32,
11     b: u32,
12 }
13
14 fn main() {
15     let mut x = Y { y: X { a: 5, b: 0 } };
16     let hello = || {
17         x.y.a += 1;
18     };
19
20     let b = hello;
21     let c = hello; //~ ERROR use of moved value: `hello` [E0382]
22 }