rust/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.4 KiB
Plaintext
Raw Normal View History

2023-07-27 17:50:40 -05:00
error[E0261]: use of undeclared lifetime name `'a`
2023-09-13 11:04:42 -05:00
--> $DIR/bad-item-bound-within-rpitit-2.rs:5:20
2023-07-27 17:50:40 -05:00
|
LL | fn bar<'other: 'a>() -> impl Sized + 'a {}
| ^^ undeclared lifetime
|
help: consider introducing lifetime `'a` here
|
LL | fn bar<'a, 'other: 'a>() -> impl Sized + 'a {}
| +++
help: consider introducing lifetime `'a` here
|
LL | trait Foo<'a> {
| ++++
error[E0261]: use of undeclared lifetime name `'a`
2023-09-13 11:04:42 -05:00
--> $DIR/bad-item-bound-within-rpitit-2.rs:5:42
2023-07-27 17:50:40 -05:00
|
LL | fn bar<'other: 'a>() -> impl Sized + 'a {}
| ^^ undeclared lifetime
|
help: consider introducing lifetime `'a` here
|
LL | fn bar<'a, 'other: 'a>() -> impl Sized + 'a {}
| +++
help: consider introducing lifetime `'a` here
|
LL | trait Foo<'a> {
| ++++
2024-03-18 11:03:18 -05:00
error[E0792]: expected generic lifetime parameter, found `'static`
--> $DIR/bad-item-bound-within-rpitit-2.rs:5:45
|
LL | fn bar<'other: 'a>() -> impl Sized + 'a {}
| ------ ^^
| |
| cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type
error: aborting due to 3 previous errors
2023-07-27 17:50:40 -05:00
2024-03-18 11:03:18 -05:00
Some errors have detailed explanations: E0261, E0792.
For more information about an error, try `rustc --explain E0261`.