2023-10-19 14:00:18 -05:00
|
|
|
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
|
|
|
|
| ^
|
|
|
|
|
|
2024-07-12 21:10:29 -05:00
|
|
|
help: add a `use<...>` bound to explicitly capture `'_`
|
2023-10-19 14:00:18 -05:00
|
|
|
|
|
2024-07-12 21:10:29 -05:00
|
|
|
LL | fn foo(x: &Vec<i32>) -> impl Sized + use<'_> {
|
|
|
|
| +++++++++
|
2023-10-19 14:00:18 -05:00
|
|
|
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0700`.
|