mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
27 lines
973 B
Plaintext
27 lines
973 B
Plaintext
error[E0700]: hidden type for `impl Sized + 'a` captures lifetime that does not appear in bounds
|
|
--> $DIR/early_bound.rs:7:17
|
|
|
|
|
LL | fn test<'a: 'a>(n: bool) -> impl Sized + 'a {
|
|
| -- --------------- opaque type defined here
|
|
| |
|
|
| hidden type `&'a ()` captures the lifetime `'a` as defined here
|
|
...
|
|
LL | let _ = identity::<&'a ()>(test(false));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: concrete type differs from previous defining opaque type use
|
|
--> $DIR/early_bound.rs:3:29
|
|
|
|
|
LL | fn test<'a: 'a>(n: bool) -> impl Sized + 'a {
|
|
| ^^^^^^^^^^^^^^^ expected `&()`, got `()`
|
|
|
|
|
note: previous use here
|
|
--> $DIR/early_bound.rs:7:36
|
|
|
|
|
LL | let _ = identity::<&'a ()>(test(false));
|
|
| ^^^^^^^^^^^
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0700`.
|