about summary refs log tree commit diff
path: root/tests/ui/feature-gates/feature-gate-lifetime-capture-rules-2024.stderr
blob: d0b18df6a5e478b6037dd9fa8f00d6f2af218e50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
  --> $DIR/feature-gate-lifetime-capture-rules-2024.rs:2:5
   |
LL | fn foo(x: &Vec<i32>) -> impl Sized {
   |           ---------     ---------- opaque type defined here
   |           |
   |           hidden type `&Vec<i32>` captures the anonymous lifetime defined here
LL |     x
   |     ^
   |
help: add a `use<...>` bound to explicitly capture `'_`
   |
LL | fn foo(x: &Vec<i32>) -> impl Sized + use<'_> {
   |                                    +++++++++

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0700`.