]> git.proxmox.com Git - rustc.git/blame - src/test/ui/borrowck/borrowck-closures-two-mut-fail.stderr
Update unsuspicious file list
[rustc.git] / src / test / ui / borrowck / borrowck-closures-two-mut-fail.stderr
CommitLineData
b7449926 1error[E0499]: cannot borrow `x` as mutable more than once at a time
0731742a 2 --> $DIR/borrowck-closures-two-mut-fail.rs:16:24
b7449926
XL
3 |
4LL | let c1 = to_fn_mut(|| x = 4);
48663c56 5 | -- - first borrow occurs due to use of `x` in closure
b7449926
XL
6 | |
7 | first mutable borrow occurs here
532ac7d7 8LL | let c2 = to_fn_mut(|| x = 5);
48663c56 9 | ^^ - second borrow occurs due to use of `x` in closure
b7449926
XL
10 | |
11 | second mutable borrow occurs here
12LL | c1;
48663c56 13 | -- first borrow later used here
b7449926
XL
14
15error[E0499]: cannot borrow `x` as mutable more than once at a time
0731742a 16 --> $DIR/borrowck-closures-two-mut-fail.rs:27:24
b7449926
XL
17 |
18LL | let c1 = to_fn_mut(|| set(&mut x));
48663c56 19 | -- - first borrow occurs due to use of `x` in closure
b7449926
XL
20 | |
21 | first mutable borrow occurs here
532ac7d7 22LL | let c2 = to_fn_mut(|| set(&mut x));
48663c56 23 | ^^ - second borrow occurs due to use of `x` in closure
b7449926
XL
24 | |
25 | second mutable borrow occurs here
26LL | c1;
48663c56 27 | -- first borrow later used here
b7449926
XL
28
29error[E0499]: cannot borrow `x` as mutable more than once at a time
0731742a 30 --> $DIR/borrowck-closures-two-mut-fail.rs:34:24
b7449926
XL
31 |
32LL | let c1 = to_fn_mut(|| x = 5);
48663c56 33 | -- - first borrow occurs due to use of `x` in closure
b7449926
XL
34 | |
35 | first mutable borrow occurs here
532ac7d7 36LL | let c2 = to_fn_mut(|| set(&mut x));
48663c56 37 | ^^ - second borrow occurs due to use of `x` in closure
b7449926
XL
38 | |
39 | second mutable borrow occurs here
40LL | c1;
48663c56 41 | -- first borrow later used here
b7449926
XL
42
43error[E0499]: cannot borrow `x` as mutable more than once at a time
0731742a 44 --> $DIR/borrowck-closures-two-mut-fail.rs:41:24
b7449926
XL
45 |
46LL | let c1 = to_fn_mut(|| x = 5);
48663c56 47 | -- - first borrow occurs due to use of `x` in closure
b7449926
XL
48 | |
49 | first mutable borrow occurs here
50LL | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
48663c56 51 | ^^ - second borrow occurs due to use of `x` in closure
b7449926
XL
52 | |
53 | second mutable borrow occurs here
48663c56
XL
54LL |
55LL | c1;
56 | -- first borrow later used here
b7449926
XL
57
58error[E0499]: cannot borrow `x` as mutable more than once at a time
0731742a 59 --> $DIR/borrowck-closures-two-mut-fail.rs:53:24
b7449926
XL
60 |
61LL | let c1 = to_fn_mut(|| set(&mut *x.f));
17df50a5 62 | -- ---- first borrow occurs due to use of `x` in closure
b7449926
XL
63 | |
64 | first mutable borrow occurs here
65LL | let c2 = to_fn_mut(|| set(&mut *x.f));
17df50a5 66 | ^^ ---- second borrow occurs due to use of `x` in closure
b7449926
XL
67 | |
68 | second mutable borrow occurs here
48663c56
XL
69LL |
70LL | c1;
71 | -- first borrow later used here
b7449926
XL
72
73error: aborting due to 5 previous errors
74
75For more information about this error, try `rustc --explain E0499`.