]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/region-borrow-params-issue-29793-small.stderr
Rollup merge of #53317 - estebank:abolish-ice, r=oli-obk
[rust.git] / src / test / ui / regions / region-borrow-params-issue-29793-small.stderr
1 error[E0597]: `x` does not live long enough
2   --> $DIR/region-borrow-params-issue-29793-small.rs:19:34
3    |
4 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
5    |                 ---------        ^ borrowed value does not live long enough
6    |                 |
7    |                 capture occurs here
8 ...
9 LL |     };
10    |     - borrowed value dropped before borrower
11    |
12    = note: values in a scope are dropped in the opposite order they are created
13
14 error[E0597]: `y` does not live long enough
15   --> $DIR/region-borrow-params-issue-29793-small.rs:19:45
16    |
17 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
18    |                 ---------                   ^ borrowed value does not live long enough
19    |                 |
20    |                 capture occurs here
21 ...
22 LL |     };
23    |     - borrowed value dropped before borrower
24    |
25    = note: values in a scope are dropped in the opposite order they are created
26
27 error[E0597]: `x` does not live long enough
28   --> $DIR/region-borrow-params-issue-29793-small.rs:34:34
29    |
30 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
31    |                 ---------        ^ borrowed value does not live long enough
32    |                 |
33    |                 capture occurs here
34 ...
35 LL |     };
36    |     - borrowed value dropped before borrower
37    |
38    = note: values in a scope are dropped in the opposite order they are created
39
40 error[E0597]: `y` does not live long enough
41   --> $DIR/region-borrow-params-issue-29793-small.rs:34:45
42    |
43 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
44    |                 ---------                   ^ borrowed value does not live long enough
45    |                 |
46    |                 capture occurs here
47 ...
48 LL |     };
49    |     - borrowed value dropped before borrower
50    |
51    = note: values in a scope are dropped in the opposite order they are created
52
53 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
54   --> $DIR/region-borrow-params-issue-29793-small.rs:65:17
55    |
56 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
57    |                 ^^^^^^^^^        - `x` is borrowed here
58    |                 |
59    |                 may outlive borrowed value `x`
60 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
61    |
62 LL |         let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
63    |                 ^^^^^^^^^^^^^^
64
65 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
66   --> $DIR/region-borrow-params-issue-29793-small.rs:65:17
67    |
68 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
69    |                 ^^^^^^^^^                   - `y` is borrowed here
70    |                 |
71    |                 may outlive borrowed value `y`
72 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
73    |
74 LL |         let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
75    |                 ^^^^^^^^^^^^^^
76
77 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
78   --> $DIR/region-borrow-params-issue-29793-small.rs:76:17
79    |
80 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
81    |                 ^^^^^^^^^        - `x` is borrowed here
82    |                 |
83    |                 may outlive borrowed value `x`
84 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
85    |
86 LL |         let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
87    |                 ^^^^^^^^^^^^^^
88
89 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
90   --> $DIR/region-borrow-params-issue-29793-small.rs:76:17
91    |
92 LL |         let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
93    |                 ^^^^^^^^^                   - `y` is borrowed here
94    |                 |
95    |                 may outlive borrowed value `y`
96 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
97    |
98 LL |         let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
99    |                 ^^^^^^^^^^^^^^
100
101 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
102   --> $DIR/region-borrow-params-issue-29793-small.rs:100:21
103    |
104 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
105    |                     ^^^^^^^^^        - `x` is borrowed here
106    |                     |
107    |                     may outlive borrowed value `x`
108 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
109    |
110 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
111    |                     ^^^^^^^^^^^^^^
112
113 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
114   --> $DIR/region-borrow-params-issue-29793-small.rs:100:21
115    |
116 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
117    |                     ^^^^^^^^^                   - `y` is borrowed here
118    |                     |
119    |                     may outlive borrowed value `y`
120 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
121    |
122 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
123    |                     ^^^^^^^^^^^^^^
124
125 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
126   --> $DIR/region-borrow-params-issue-29793-small.rs:114:21
127    |
128 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
129    |                     ^^^^^^^^^        - `x` is borrowed here
130    |                     |
131    |                     may outlive borrowed value `x`
132 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
133    |
134 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
135    |                     ^^^^^^^^^^^^^^
136
137 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
138   --> $DIR/region-borrow-params-issue-29793-small.rs:114:21
139    |
140 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
141    |                     ^^^^^^^^^                   - `y` is borrowed here
142    |                     |
143    |                     may outlive borrowed value `y`
144 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
145    |
146 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
147    |                     ^^^^^^^^^^^^^^
148
149 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
150   --> $DIR/region-borrow-params-issue-29793-small.rs:142:21
151    |
152 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
153    |                     ^^^^^^^^^        - `x` is borrowed here
154    |                     |
155    |                     may outlive borrowed value `x`
156 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
157    |
158 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
159    |                     ^^^^^^^^^^^^^^
160
161 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
162   --> $DIR/region-borrow-params-issue-29793-small.rs:142:21
163    |
164 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
165    |                     ^^^^^^^^^                   - `y` is borrowed here
166    |                     |
167    |                     may outlive borrowed value `y`
168 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
169    |
170 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
171    |                     ^^^^^^^^^^^^^^
172
173 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
174   --> $DIR/region-borrow-params-issue-29793-small.rs:157:21
175    |
176 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
177    |                     ^^^^^^^^^        - `x` is borrowed here
178    |                     |
179    |                     may outlive borrowed value `x`
180 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
181    |
182 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
183    |                     ^^^^^^^^^^^^^^
184
185 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
186   --> $DIR/region-borrow-params-issue-29793-small.rs:157:21
187    |
188 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
189    |                     ^^^^^^^^^                   - `y` is borrowed here
190    |                     |
191    |                     may outlive borrowed value `y`
192 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
193    |
194 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
195    |                     ^^^^^^^^^^^^^^
196
197 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
198   --> $DIR/region-borrow-params-issue-29793-small.rs:185:21
199    |
200 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
201    |                     ^^^^^^^^^        - `x` is borrowed here
202    |                     |
203    |                     may outlive borrowed value `x`
204 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
205    |
206 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
207    |                     ^^^^^^^^^^^^^^
208
209 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
210   --> $DIR/region-borrow-params-issue-29793-small.rs:185:21
211    |
212 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
213    |                     ^^^^^^^^^                   - `y` is borrowed here
214    |                     |
215    |                     may outlive borrowed value `y`
216 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
217    |
218 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
219    |                     ^^^^^^^^^^^^^^
220
221 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
222   --> $DIR/region-borrow-params-issue-29793-small.rs:199:21
223    |
224 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
225    |                     ^^^^^^^^^        - `x` is borrowed here
226    |                     |
227    |                     may outlive borrowed value `x`
228 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
229    |
230 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
231    |                     ^^^^^^^^^^^^^^
232
233 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
234   --> $DIR/region-borrow-params-issue-29793-small.rs:199:21
235    |
236 LL |             let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
237    |                     ^^^^^^^^^                   - `y` is borrowed here
238    |                     |
239    |                     may outlive borrowed value `y`
240 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
241    |
242 LL |             let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
243    |                     ^^^^^^^^^^^^^^
244
245 error: aborting due to 20 previous errors
246
247 Some errors occurred: E0373, E0597.
248 For more information about an error, try `rustc --explain E0373`.