]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/impl-trait/region-escape-via-bound.stderr
Rollup merge of #93400 - ChayimFriedman2:dont-suggest-using-const-with-bounds-unused...
[rust.git] / src / test / ui / impl-trait / region-escape-via-bound.stderr
index 690d049ec8f620bc1de240d1f61197562e646779..ecec34e0115c67205e8ef18382323cb60151a975 100644 (file)
@@ -1,16 +1,15 @@
 error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
-  --> $DIR/region-escape-via-bound.rs:18:5
+  --> $DIR/region-escape-via-bound.rs:14:37
    |
-LL | where 'x: 'y
-   |       -- hidden type `Cell<&'x u32>` captures the lifetime `'x` as defined here
-LL | {
-LL |     x
-   |     ^
+LL | fn foo<'x, 'y>(x: Cell<&'x u32>) -> impl Trait<'y>
+   |        --                           ^^^^^^^^^^^^^^
+   |        |
+   |        hidden type `Cell<&'x u32>` captures the lifetime `'x` as defined here
    |
 help: to declare that the `impl Trait` captures `'x`, you can add an explicit `'x` lifetime bound
    |
-LL | fn foo(x: Cell<&'x u32>) -> impl Trait<'y> + 'x
-   |                                            ++++
+LL | fn foo<'x, 'y>(x: Cell<&'x u32>) -> impl Trait<'y> + 'x
+   |                                                    ++++
 
 error: aborting due to previous error