]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/nll/ty-outlives/impl-trait-captures.stderr
Update unsuspicious file list
[rustc.git] / src / test / ui / nll / ty-outlives / impl-trait-captures.stderr
index f836960a28cf372d4b492945dd41ab6fcdb1deb7..7b9ed171d2dbf88b0f2fbbcc931117731bb19436 100644 (file)
@@ -1,17 +1,16 @@
-warning: not reporting region error due to nll
-  --> $DIR/impl-trait-captures.rs:21:5
+error[E0700]: hidden type for `Opaque(DefId(0:13 ~ impl_trait_captures[1afc]::foo::{opaque#0}), [ReEarlyBound(0, 'a), T, ReEarlyBound(0, 'a)])` captures lifetime that does not appear in bounds
+  --> $DIR/impl-trait-captures.rs:11:5
    |
+LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> {
+   |                  -- hidden type `&ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_)) T` captures the anonymous lifetime defined here
 LL |     x
    |     ^
-
-error[E0621]: explicit lifetime required in the type of `x`
-  --> $DIR/impl-trait-captures.rs:21:5
    |
-LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> {
-   |               - consider changing the type of `x` to `&ReEarlyBound(0, 'a) T`
-LL |     x
-   |     ^ lifetime `ReEarlyBound(0, 'a)` required
+help: to declare that `Opaque(DefId(0:13 ~ impl_trait_captures[1afc]::foo::{opaque#0}), [ReEarlyBound(0, 'a), T, ReEarlyBound(2, 'a)])` captures `ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_))`, you can add an explicit `ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_))` lifetime bound
+   |
+LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> + ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_)) {
+   |                                      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0621`.
+For more information about this error, try `rustc --explain E0700`.