]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/user-annotations/method-ufcs-2.stderr
Rollup merge of #106441 - mllken:abstract-socket-noref, r=joshtriplett
[rust.git] / tests / ui / nll / user-annotations / method-ufcs-2.stderr
1 error[E0597]: `a` does not live long enough
2   --> $DIR/method-ufcs-2.rs:30:7
3    |
4 LL |     x(&a, b, c);
5    |     --^^-------
6    |     | |
7    |     | borrowed value does not live long enough
8    |     argument requires that `a` is borrowed for `'static`
9 LL | }
10    | - `a` dropped here while still borrowed
11
12 error[E0597]: `b` does not live long enough
13   --> $DIR/method-ufcs-2.rs:37:39
14    |
15 LL | fn annot_reference_named_lifetime<'a>(_d: &'a u32) {
16    |                                   -- lifetime `'a` defined here
17 ...
18 LL |     <_ as Bazoom<&'a u32>>::method(a, &b, c);
19    |     ----------------------------------^^----
20    |     |                                 |
21    |     |                                 borrowed value does not live long enough
22    |     argument requires that `b` is borrowed for `'a`
23 LL | }
24    | - `b` dropped here while still borrowed
25
26 error[E0597]: `b` does not live long enough
27   --> $DIR/method-ufcs-2.rs:51:44
28    |
29 LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
30    |                                              -- lifetime `'a` defined here
31 ...
32 LL |     let _closure = || {
33    |                    -- value captured here
34 LL |         let c = 66;
35 LL |         <_ as Bazoom<&'a u32>>::method(a, &b, c);
36    |         -----------------------------------^----
37    |         |                                  |
38    |         |                                  borrowed value does not live long enough
39    |         argument requires that `b` is borrowed for `'a`
40 LL |     };
41 LL | }
42    | - `b` dropped here while still borrowed
43
44 error: aborting due to 3 previous errors
45
46 For more information about this error, try `rustc --explain E0597`.