]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/suggestions/impl-trait-missing-lifetime-gated.stderr
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / suggestions / impl-trait-missing-lifetime-gated.stderr
index e82a6f769e090083d7c8ce9165d59309b61eae0f..9833da13ffc2a3a6e6e7256d3bb654b1941ad6ce 100644 (file)
@@ -26,17 +26,25 @@ error[E0658]: anonymous lifetimes in `impl Trait` are unstable
   --> $DIR/impl-trait-missing-lifetime-gated.rs:5:31
    |
 LL | fn f(_: impl Iterator<Item = &'_ ()>) {}
-   |                               ^^
+   |                               ^^ expected named lifetime parameter
    |
    = help: add `#![feature(anonymous_lifetime_in_impl_trait)]` to the crate attributes to enable
+help: consider introducing a named lifetime parameter
+   |
+LL | fn f<'a>(_: impl Iterator<Item = &'_'a  ()>) {}
+   |     ++++                            ++
 
 error[E0658]: anonymous lifetimes in `impl Trait` are unstable
   --> $DIR/impl-trait-missing-lifetime-gated.rs:8:31
    |
 LL | fn g(x: impl Iterator<Item = &'_ ()>) -> Option<&'_ ()> { x.next() }
-   |                               ^^
+   |                               ^^ expected named lifetime parameter
    |
    = help: add `#![feature(anonymous_lifetime_in_impl_trait)]` to the crate attributes to enable
+help: consider introducing a named lifetime parameter
+   |
+LL | fn g<'a>(x: impl Iterator<Item = &'_'a  ()>) -> Option<&'_ ()> { x.next() }
+   |     ++++                            ++
 
 error: aborting due to 4 previous errors