Skip to content

Commit a724d9a

Browse files
committed
Fix NLL output
1 parent 99d9ccd commit a724d9a

File tree

2 files changed

+98
-12
lines changed

2 files changed

+98
-12
lines changed
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
error[E0261]: use of undeclared lifetime name `'a`
2+
--> $DIR/missing-lifetimes-in-signature.rs:37:11
3+
|
4+
LL | fn baz<G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
5+
| - ^^ undeclared lifetime
6+
| |
7+
| help: consider introducing lifetime `'a` here: `'a,`
8+
9+
error: lifetime may not live long enough
10+
--> $DIR/missing-lifetimes-in-signature.rs:15:37
11+
|
12+
LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce()
13+
| - ^^^^^^^^^^^^^ opaque type requires that `'1` must outlive `'static`
14+
| |
15+
| let's call the lifetime of this reference `'1`
16+
|
17+
help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a bound
18+
|
19+
LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
20+
| ^^^^^^^^^^^^^^^^^^
21+
22+
error[E0311]: the parameter type `G` may not live long enough
23+
--> $DIR/missing-lifetimes-in-signature.rs:25:37
24+
|
25+
LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
26+
| ^^^^^^^^^^^^^^^^^^
27+
|
28+
note: the parameter type `G` must be valid for the anonymous lifetime #1 defined on the function body at 25:1...
29+
--> $DIR/missing-lifetimes-in-signature.rs:25:1
30+
|
31+
LL | / fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
32+
LL | |
33+
LL | | where
34+
LL | | G: Get<T>
35+
... |
36+
LL | | }
37+
LL | | }
38+
| |_^
39+
40+
error[E0311]: the parameter type `G` may not live long enough
41+
--> $DIR/missing-lifetimes-in-signature.rs:47:45
42+
|
43+
LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
44+
| ^^^^^^^^^^^^^^^^^^
45+
|
46+
note: the parameter type `G` must be valid for the anonymous lifetime #1 defined on the function body at 47:1...
47+
--> $DIR/missing-lifetimes-in-signature.rs:47:1
48+
|
49+
LL | / fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
50+
LL | |
51+
LL | | where
52+
LL | | G: Get<T>
53+
... |
54+
LL | | }
55+
LL | | }
56+
| |_^
57+
58+
error[E0311]: the parameter type `G` may not live long enough
59+
--> $DIR/missing-lifetimes-in-signature.rs:58:45
60+
|
61+
LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
62+
| ^^^^^^^^^^^^^^^^^^^^^^^
63+
|
64+
note: the parameter type `G` must be valid for the anonymous lifetime #1 defined on the function body at 58:1...
65+
--> $DIR/missing-lifetimes-in-signature.rs:58:1
66+
|
67+
LL | / fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
68+
LL | |
69+
LL | | where
70+
LL | | G: Get<T>
71+
... |
72+
LL | | }
73+
LL | | }
74+
| |_^
75+
76+
error[E0621]: explicit lifetime required in the type of `dest`
77+
--> $DIR/missing-lifetimes-in-signature.rs:63:5
78+
|
79+
LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
80+
| ------ help: add explicit lifetime `'a` to the type of `dest`: `&'a mut T`
81+
...
82+
LL | / move || {
83+
LL | | *dest = g.get();
84+
LL | | }
85+
| |_____^ lifetime `'a` required
86+
87+
error[E0309]: the parameter type `G` may not live long enough
88+
--> $DIR/missing-lifetimes-in-signature.rs:69:44
89+
|
90+
LL | fn bak<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
91+
| ^^^^^^^^^^^^^^^^^^
92+
|
93+
= help: consider adding an explicit lifetime bound `G: 'a`...
94+
95+
error: aborting due to 7 previous errors
96+
97+
Some errors have detailed explanations: E0261, E0309, E0621.
98+
For more information about an error, try `rustc --explain E0261`.

src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)