2024-04-04 14:46:26 -04:00
|
|
|
error: `impl Trait` captures lifetime parameter, but it is not mentioned in `use<...>` precise captures list
|
2024-07-12 06:12:24 -04:00
|
|
|
--> $DIR/forgot-to-capture-lifetime.rs:1:52
|
2024-04-04 12:54:56 -04:00
|
|
|
|
|
2024-06-05 16:18:52 -04:00
|
|
|
LL | fn lifetime_in_bounds<'a>(x: &'a ()) -> impl Into<&'a ()> + use<> { x }
|
|
|
|
|
| -- -----------^^------------
|
2024-04-04 14:46:26 -04:00
|
|
|
| | |
|
|
|
|
|
| | lifetime captured due to being mentioned in the bounds of the `impl Trait`
|
|
|
|
|
| this lifetime parameter is captured
|
|
|
|
|
|
|
|
|
|
error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
|
2024-07-12 06:12:24 -04:00
|
|
|
--> $DIR/forgot-to-capture-lifetime.rs:4:62
|
2024-04-04 14:46:26 -04:00
|
|
|
|
|
2024-06-05 16:18:52 -04:00
|
|
|
LL | fn lifetime_in_hidden<'a>(x: &'a ()) -> impl Sized + use<> { x }
|
|
|
|
|
| -- ------------------ ^
|
2024-04-04 14:46:26 -04:00
|
|
|
| | |
|
|
|
|
|
| | opaque type defined here
|
|
|
|
|
| hidden type `&'a ()` captures the lifetime `'a` as defined here
|
|
|
|
|
|
|
2024-07-11 14:00:54 -04:00
|
|
|
help: add `'a` to the `use<...>` bound to explicitly capture it
|
2024-04-04 12:54:56 -04:00
|
|
|
|
|
2024-07-11 14:00:54 -04:00
|
|
|
LL | fn lifetime_in_hidden<'a>(x: &'a ()) -> impl Sized + use<'a> { x }
|
|
|
|
|
| ++
|
2024-04-04 12:54:56 -04:00
|
|
|
|
2024-06-16 22:07:23 -04:00
|
|
|
error: aborting due to 2 previous errors
|
2024-04-04 12:54:56 -04:00
|
|
|
|
2024-04-04 14:46:26 -04:00
|
|
|
For more information about this error, try `rustc --explain E0700`.
|