]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/impl-trait-missing-lifetime-gated.stderr
Rollup merge of #106919 - compiler-errors:underscore-typo-in-field-pat, r=jackh726
[rust.git] / tests / ui / suggestions / impl-trait-missing-lifetime-gated.stderr
1 error[E0106]: missing lifetime specifier
2   --> $DIR/impl-trait-missing-lifetime-gated.rs:9:54
3    |
4 LL |     fn g(mut x: impl Iterator<Item = &()>) -> Option<&()> { x.next() }
5    |                                                      ^ expected named lifetime parameter
6    |
7    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
8 help: consider using the `'static` lifetime
9    |
10 LL |     fn g(mut x: impl Iterator<Item = &()>) -> Option<&'static ()> { x.next() }
11    |                                                       +++++++
12
13 error[E0106]: missing lifetime specifier
14   --> $DIR/impl-trait-missing-lifetime-gated.rs:19:60
15    |
16 LL |     async fn i(mut x: impl Iterator<Item = &()>) -> Option<&()> { x.next() }
17    |                                                            ^ expected named lifetime parameter
18    |
19    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
20 help: consider using the `'static` lifetime
21    |
22 LL |     async fn i(mut x: impl Iterator<Item = &()>) -> Option<&'static ()> { x.next() }
23    |                                                             +++++++
24
25 error[E0106]: missing lifetime specifier
26   --> $DIR/impl-trait-missing-lifetime-gated.rs:27:58
27    |
28 LL |     fn g(mut x: impl Iterator<Item = &'_ ()>) -> Option<&'_ ()> { x.next() }
29    |                                                          ^^ expected named lifetime parameter
30    |
31    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
32 help: consider using the `'static` lifetime
33    |
34 LL |     fn g(mut x: impl Iterator<Item = &'_ ()>) -> Option<&'static ()> { x.next() }
35    |                                                          ~~~~~~~
36
37 error[E0106]: missing lifetime specifier
38   --> $DIR/impl-trait-missing-lifetime-gated.rs:37:64
39    |
40 LL |     async fn i(mut x: impl Iterator<Item = &'_ ()>) -> Option<&'_ ()> { x.next() }
41    |                                                                ^^ expected named lifetime parameter
42    |
43    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
44 help: consider using the `'static` lifetime
45    |
46 LL |     async fn i(mut x: impl Iterator<Item = &'_ ()>) -> Option<&'static ()> { x.next() }
47    |                                                                ~~~~~~~
48
49 error[E0106]: missing lifetime specifier
50   --> $DIR/impl-trait-missing-lifetime-gated.rs:47:37
51    |
52 LL |     fn g(mut x: impl Foo) -> Option<&()> { x.next() }
53    |                                     ^ expected named lifetime parameter
54    |
55    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
56 help: consider using the `'static` lifetime
57    |
58 LL |     fn g(mut x: impl Foo) -> Option<&'static ()> { x.next() }
59    |                                      +++++++
60
61 error[E0106]: missing lifetime specifier
62   --> $DIR/impl-trait-missing-lifetime-gated.rs:58:41
63    |
64 LL |     fn g(mut x: impl Foo<()>) -> Option<&()> { x.next() }
65    |                                         ^ expected named lifetime parameter
66    |
67    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
68 help: consider using the `'static` lifetime
69    |
70 LL |     fn g(mut x: impl Foo<()>) -> Option<&'static ()> { x.next() }
71    |                                          +++++++
72
73 error[E0658]: anonymous lifetimes in `impl Trait` are unstable
74   --> $DIR/impl-trait-missing-lifetime-gated.rs:6:35
75    |
76 LL |     fn f(_: impl Iterator<Item = &()>) {}
77    |                                   ^ expected named lifetime parameter
78    |
79    = help: add `#![feature(anonymous_lifetime_in_impl_trait)]` to the crate attributes to enable
80 help: consider introducing a named lifetime parameter
81    |
82 LL |     fn f<'a>(_: impl Iterator<Item = &'a ()>) {}
83    |         ++++                          ++
84
85 error[E0658]: anonymous lifetimes in `impl Trait` are unstable
86   --> $DIR/impl-trait-missing-lifetime-gated.rs:9:39
87    |
88 LL |     fn g(mut x: impl Iterator<Item = &()>) -> Option<&()> { x.next() }
89    |                                       ^ expected named lifetime parameter
90    |
91    = help: add `#![feature(anonymous_lifetime_in_impl_trait)]` to the crate attributes to enable
92 help: consider introducing a named lifetime parameter
93    |
94 LL |     fn g<'a>(mut x: impl Iterator<Item = &'a ()>) -> Option<&()> { x.next() }
95    |         ++++                              ++
96
97 error[E0658]: anonymous lifetimes in `impl Trait` are unstable
98   --> $DIR/impl-trait-missing-lifetime-gated.rs:24:35
99    |
100 LL |     fn f(_: impl Iterator<Item = &'_ ()>) {}
101    |                                   ^^ expected named lifetime parameter
102    |
103    = help: add `#![feature(anonymous_lifetime_in_impl_trait)]` to the crate attributes to enable
104 help: consider introducing a named lifetime parameter
105    |
106 LL |     fn f<'a>(_: impl Iterator<Item = &'a ()>) {}
107    |         ++++                          ~~
108
109 error[E0658]: anonymous lifetimes in `impl Trait` are unstable
110   --> $DIR/impl-trait-missing-lifetime-gated.rs:27:39
111    |
112 LL |     fn g(mut x: impl Iterator<Item = &'_ ()>) -> Option<&'_ ()> { x.next() }
113    |                                       ^^ expected named lifetime parameter
114    |
115    = help: add `#![feature(anonymous_lifetime_in_impl_trait)]` to the crate attributes to enable
116 help: consider introducing a named lifetime parameter
117    |
118 LL |     fn g<'a>(mut x: impl Iterator<Item = &'a ()>) -> Option<&'_ ()> { x.next() }
119    |         ++++                              ~~
120
121 error[E0658]: anonymous lifetimes in `impl Trait` are unstable
122   --> $DIR/impl-trait-missing-lifetime-gated.rs:44:18
123    |
124 LL |     fn f(_: impl Foo) {}
125    |                  ^^^ expected named lifetime parameter
126    |
127    = help: add `#![feature(anonymous_lifetime_in_impl_trait)]` to the crate attributes to enable
128 help: consider introducing a named lifetime parameter
129    |
130 LL |     fn f<'a>(_: impl Foo<'a>) {}
131    |         ++++            ++++
132
133 error[E0658]: anonymous lifetimes in `impl Trait` are unstable
134   --> $DIR/impl-trait-missing-lifetime-gated.rs:47:22
135    |
136 LL |     fn g(mut x: impl Foo) -> Option<&()> { x.next() }
137    |                      ^^^ expected named lifetime parameter
138    |
139    = help: add `#![feature(anonymous_lifetime_in_impl_trait)]` to the crate attributes to enable
140 help: consider introducing a named lifetime parameter
141    |
142 LL |     fn g<'a>(mut x: impl Foo<'a>) -> Option<&()> { x.next() }
143    |         ++++                ++++
144
145 error[E0658]: anonymous lifetimes in `impl Trait` are unstable
146   --> $DIR/impl-trait-missing-lifetime-gated.rs:55:22
147    |
148 LL |     fn f(_: impl Foo<()>) {}
149    |                      ^ expected named lifetime parameter
150    |
151    = help: add `#![feature(anonymous_lifetime_in_impl_trait)]` to the crate attributes to enable
152 help: consider introducing a named lifetime parameter
153    |
154 LL |     fn f<'a>(_: impl Foo<'a, ()>) {}
155    |         ++++             +++
156
157 error[E0658]: anonymous lifetimes in `impl Trait` are unstable
158   --> $DIR/impl-trait-missing-lifetime-gated.rs:58:26
159    |
160 LL |     fn g(mut x: impl Foo<()>) -> Option<&()> { x.next() }
161    |                          ^ expected named lifetime parameter
162    |
163    = help: add `#![feature(anonymous_lifetime_in_impl_trait)]` to the crate attributes to enable
164 help: consider introducing a named lifetime parameter
165    |
166 LL |     fn g<'a>(mut x: impl Foo<'a, ()>) -> Option<&()> { x.next() }
167    |         ++++                 +++
168
169 error: aborting due to 14 previous errors
170
171 Some errors have detailed explanations: E0106, E0658.
172 For more information about an error, try `rustc --explain E0106`.