]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/user-annotations/adt-tuple-struct-calls.stderr
Auto merge of #107054 - petrochenkov:effvisdoc3, r=GuillaumeGomez
[rust.git] / tests / ui / nll / user-annotations / adt-tuple-struct-calls.stderr
1 error[E0597]: `c` does not live long enough
2   --> $DIR/adt-tuple-struct-calls.rs:27:7
3    |
4 LL |     let c = 66;
5    |         - binding `c` declared here
6 LL |     let f = SomeStruct::<&'static u32>;
7 LL |     f(&c);
8    |     --^^-
9    |     | |
10    |     | borrowed value does not live long enough
11    |     argument requires that `c` is borrowed for `'static`
12 LL | }
13    | - `c` dropped here while still borrowed
14
15 error[E0597]: `c` does not live long enough
16   --> $DIR/adt-tuple-struct-calls.rs:33:7
17    |
18 LL | fn annot_reference_named_lifetime<'a>(_d: &'a u32) {
19    |                                   -- lifetime `'a` defined here
20 LL |     let c = 66;
21    |         - binding `c` declared here
22 LL |     let f = SomeStruct::<&'a u32>;
23 LL |     f(&c);
24    |     --^^-
25    |     | |
26    |     | borrowed value does not live long enough
27    |     argument requires that `c` is borrowed for `'a`
28 LL | }
29    | - `c` dropped here while still borrowed
30
31 error[E0597]: `c` does not live long enough
32   --> $DIR/adt-tuple-struct-calls.rs:45:11
33    |
34 LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
35    |                                              -- lifetime `'a` defined here
36 ...
37 LL |         f(&c);
38    |         --^^-
39    |         | |
40    |         | borrowed value does not live long enough
41    |         argument requires that `c` is borrowed for `'a`
42 LL |     };
43    |     - `c` dropped here while still borrowed
44
45 error[E0597]: `c` does not live long enough
46   --> $DIR/adt-tuple-struct-calls.rs:53:11
47    |
48 LL |     let f = SomeStruct::<&'a u32>;
49    |         - lifetime `'1` appears in the type of `f`
50 ...
51 LL |         f(&c);
52    |         --^^-
53    |         | |
54    |         | borrowed value does not live long enough
55    |         argument requires that `c` is borrowed for `'1`
56 LL |     };
57    |     - `c` dropped here while still borrowed
58
59 error: aborting due to 4 previous errors
60
61 For more information about this error, try `rustc --explain E0597`.