Add additional test

This commit is contained in:
Michael Goulet 2023-07-27 22:50:40 +00:00
parent bf38111ac1
commit ea2f8b346b
2 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,11 @@
// issue: 114146
#![feature(return_position_impl_trait_in_trait)]
trait Foo {
fn bar<'other: 'a>() -> impl Sized + 'a {}
//~^ ERROR use of undeclared lifetime name `'a`
//~| ERROR use of undeclared lifetime name `'a`
}
fn main() {}

View File

@ -0,0 +1,33 @@
error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/bad-item-bound-within-rpitit-2.rs:6:20
|
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`
--> $DIR/bad-item-bound-within-rpitit-2.rs:6:42
|
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: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0261`.