]> git.proxmox.com Git - rustc.git/blob - src/test/ui/borrowck/borrowck-closures-two-mut.stderr
New upstream version 1.23.0+dfsg1
[rustc.git] / src / test / ui / borrowck / borrowck-closures-two-mut.stderr
1 error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
2 --> $DIR/borrowck-closures-two-mut.rs:24:24
3 |
4 23 | let c1 = to_fn_mut(|| x = 4);
5 | -- - previous borrow occurs due to use of `x` in closure
6 | |
7 | first mutable borrow occurs here
8 24 | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once
9 | ^^ - borrow occurs due to use of `x` in closure
10 | |
11 | second mutable borrow occurs here
12 25 | }
13 | - first borrow ends here
14
15 error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
16 --> $DIR/borrowck-closures-two-mut.rs:34:24
17 |
18 33 | let c1 = to_fn_mut(|| set(&mut x));
19 | -- - previous borrow occurs due to use of `x` in closure
20 | |
21 | first mutable borrow occurs here
22 34 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
23 | ^^ - borrow occurs due to use of `x` in closure
24 | |
25 | second mutable borrow occurs here
26 35 | }
27 | - first borrow ends here
28
29 error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
30 --> $DIR/borrowck-closures-two-mut.rs:40:24
31 |
32 39 | let c1 = to_fn_mut(|| x = 5);
33 | -- - previous borrow occurs due to use of `x` in closure
34 | |
35 | first mutable borrow occurs here
36 40 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
37 | ^^ - borrow occurs due to use of `x` in closure
38 | |
39 | second mutable borrow occurs here
40 41 | }
41 | - first borrow ends here
42
43 error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
44 --> $DIR/borrowck-closures-two-mut.rs:46:24
45 |
46 45 | let c1 = to_fn_mut(|| x = 5);
47 | -- - previous borrow occurs due to use of `x` in closure
48 | |
49 | first mutable borrow occurs here
50 46 | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
51 | ^^ - borrow occurs due to use of `x` in closure
52 | |
53 | second mutable borrow occurs here
54 47 | //~^ ERROR cannot borrow `x` as mutable more than once
55 48 | }
56 | - first borrow ends here
57
58 error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
59 --> $DIR/borrowck-closures-two-mut.rs:57:24
60 |
61 56 | let c1 = to_fn_mut(|| set(&mut *x.f));
62 | -- - previous borrow occurs due to use of `x` in closure
63 | |
64 | first mutable borrow occurs here
65 57 | let c2 = to_fn_mut(|| set(&mut *x.f));
66 | ^^ - borrow occurs due to use of `x` in closure
67 | |
68 | second mutable borrow occurs here
69 58 | //~^ ERROR cannot borrow `x` as mutable more than once
70 59 | }
71 | - first borrow ends here
72
73 error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
74 --> $DIR/borrowck-closures-two-mut.rs:24:24
75 |
76 23 | let c1 = to_fn_mut(|| x = 4);
77 | -- - previous borrow occurs due to use of `x` in closure
78 | |
79 | first mutable borrow occurs here
80 24 | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once
81 | ^^ - borrow occurs due to use of `x` in closure
82 | |
83 | second mutable borrow occurs here
84 25 | }
85 | - first borrow ends here
86
87 error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
88 --> $DIR/borrowck-closures-two-mut.rs:34:24
89 |
90 33 | let c1 = to_fn_mut(|| set(&mut x));
91 | -- - previous borrow occurs due to use of `x` in closure
92 | |
93 | first mutable borrow occurs here
94 34 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
95 | ^^ - borrow occurs due to use of `x` in closure
96 | |
97 | second mutable borrow occurs here
98 35 | }
99 | - first borrow ends here
100
101 error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
102 --> $DIR/borrowck-closures-two-mut.rs:40:24
103 |
104 39 | let c1 = to_fn_mut(|| x = 5);
105 | -- - previous borrow occurs due to use of `x` in closure
106 | |
107 | first mutable borrow occurs here
108 40 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
109 | ^^ - borrow occurs due to use of `x` in closure
110 | |
111 | second mutable borrow occurs here
112 41 | }
113 | - first borrow ends here
114
115 error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
116 --> $DIR/borrowck-closures-two-mut.rs:46:24
117 |
118 45 | let c1 = to_fn_mut(|| x = 5);
119 | -- - previous borrow occurs due to use of `x` in closure
120 | |
121 | first mutable borrow occurs here
122 46 | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
123 | ^^ - borrow occurs due to use of `x` in closure
124 | |
125 | second mutable borrow occurs here
126 47 | //~^ ERROR cannot borrow `x` as mutable more than once
127 48 | }
128 | - first borrow ends here
129
130 error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
131 --> $DIR/borrowck-closures-two-mut.rs:57:24
132 |
133 56 | let c1 = to_fn_mut(|| set(&mut *x.f));
134 | -- - previous borrow occurs due to use of `x` in closure
135 | |
136 | first mutable borrow occurs here
137 57 | let c2 = to_fn_mut(|| set(&mut *x.f));
138 | ^^ - borrow occurs due to use of `x` in closure
139 | |
140 | second mutable borrow occurs here
141 58 | //~^ ERROR cannot borrow `x` as mutable more than once
142 59 | }
143 | - first borrow ends here
144
145 error: aborting due to 10 previous errors
146