]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr
Make const/fn return params more suggestable
[rust.git] / tests / ui / suggestions / lifetimes / missing-lifetimes-in-signature.stderr
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[E0700]: hidden type for `impl FnOnce()` captures lifetime that does not appear in bounds
10   --> $DIR/missing-lifetimes-in-signature.rs:19:5
11    |
12 LL |   fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce()
13    |                            ------ hidden type `[closure@$DIR/missing-lifetimes-in-signature.rs:19:5: 19:12]` captures the anonymous lifetime defined here
14 ...
15 LL | /     move || {
16 LL | |
17 LL | |         *dest = g.get();
18 LL | |     }
19    | |_____^
20    |
21 help: to declare that `impl FnOnce()` captures `'_`, you can add an explicit `'_` lifetime bound
22    |
23 LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
24    |                                                   ++++
25
26 error[E0311]: the parameter type `G` may not live long enough
27   --> $DIR/missing-lifetimes-in-signature.rs:30:5
28    |
29 LL | /     move || {
30 LL | |
31 LL | |         *dest = g.get();
32 LL | |     }
33    | |_____^
34    |
35 note: the parameter type `G` must be valid for the anonymous lifetime defined here...
36   --> $DIR/missing-lifetimes-in-signature.rs:26:26
37    |
38 LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
39    |                          ^^^^^^
40 note: ...so that the type `G` will meet its required lifetime bounds
41   --> $DIR/missing-lifetimes-in-signature.rs:30:5
42    |
43 LL | /     move || {
44 LL | |
45 LL | |         *dest = g.get();
46 LL | |     }
47    | |_____^
48 help: consider adding an explicit lifetime bound...
49    |
50 LL ~ fn bar<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + '_
51 LL | where
52 LL ~     G: Get<T> + 'a,
53    |
54
55 error[E0311]: the parameter type `G` may not live long enough
56   --> $DIR/missing-lifetimes-in-signature.rs:52:5
57    |
58 LL | /     move || {
59 LL | |
60 LL | |         *dest = g.get();
61 LL | |     }
62    | |_____^
63    |
64 note: the parameter type `G` must be valid for the anonymous lifetime defined here...
65   --> $DIR/missing-lifetimes-in-signature.rs:48:34
66    |
67 LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
68    |                                  ^^^^^^
69 note: ...so that the type `G` will meet its required lifetime bounds
70   --> $DIR/missing-lifetimes-in-signature.rs:52:5
71    |
72 LL | /     move || {
73 LL | |
74 LL | |         *dest = g.get();
75 LL | |     }
76    | |_____^
77 help: consider adding an explicit lifetime bound...
78    |
79 LL | fn qux<'b, 'a, G: 'a + 'b, T>(g: G, dest: &'b mut T) -> impl FnOnce() + '_
80    |        +++           ++++                  ++
81
82 error[E0311]: the parameter type `G` may not live long enough
83   --> $DIR/missing-lifetimes-in-signature.rs:61:9
84    |
85 LL | /         move || {
86 LL | |
87 LL | |             *dest = g.get();
88 LL | |         }
89    | |_________^
90    |
91 note: the parameter type `G` must be valid for the anonymous lifetime defined here...
92   --> $DIR/missing-lifetimes-in-signature.rs:60:47
93    |
94 LL |     fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
95    |                                               ^^^^^^
96 note: ...so that the type `G` will meet its required lifetime bounds
97   --> $DIR/missing-lifetimes-in-signature.rs:61:9
98    |
99 LL | /         move || {
100 LL | |
101 LL | |             *dest = g.get();
102 LL | |         }
103    | |_________^
104 help: consider adding an explicit lifetime bound...
105    |
106 LL |     fn qux<'c, 'b, G: Get<T> + 'b + 'c, T>(g: G, dest: &'c mut T) -> impl FnOnce() + '_ {
107    |            +++                    ++++                  ++
108
109 error[E0311]: the parameter type `G` may not live long enough
110   --> $DIR/missing-lifetimes-in-signature.rs:73:5
111    |
112 LL | /     move || {
113 LL | |
114 LL | |
115 LL | |         *dest = g.get();
116 LL | |     }
117    | |_____^
118    |
119 note: the parameter type `G` must be valid for the anonymous lifetime defined here...
120   --> $DIR/missing-lifetimes-in-signature.rs:69:34
121    |
122 LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
123    |                                  ^^^^^^
124 note: ...so that the type `G` will meet its required lifetime bounds
125   --> $DIR/missing-lifetimes-in-signature.rs:73:5
126    |
127 LL | /     move || {
128 LL | |
129 LL | |
130 LL | |         *dest = g.get();
131 LL | |     }
132    | |_____^
133 help: consider adding an explicit lifetime bound...
134    |
135 LL | fn bat<'b, 'a, G: 'a + 'b, T>(g: G, dest: &'b mut T) -> impl FnOnce() + '_ + 'a
136    |        +++           ++++                  ++
137
138 error[E0621]: explicit lifetime required in the type of `dest`
139   --> $DIR/missing-lifetimes-in-signature.rs:73:5
140    |
141 LL |   fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
142    |                                    ------ help: add explicit lifetime `'a` to the type of `dest`: `&'a mut T`
143 ...
144 LL | /     move || {
145 LL | |
146 LL | |
147 LL | |         *dest = g.get();
148 LL | |     }
149    | |_____^ lifetime `'a` required
150
151 error[E0309]: the parameter type `G` may not live long enough
152   --> $DIR/missing-lifetimes-in-signature.rs:85:5
153    |
154 LL | /     move || {
155 LL | |
156 LL | |         *dest = g.get();
157 LL | |     }
158    | |_____^ ...so that the type `G` will meet its required lifetime bounds
159    |
160 help: consider adding an explicit lifetime bound...
161    |
162 LL |     G: Get<T> + 'a,
163    |               ++++
164
165 error: aborting due to 8 previous errors
166
167 Some errors have detailed explanations: E0261, E0309, E0311, E0621, E0700.
168 For more information about an error, try `rustc --explain E0261`.