Skip to content

Commit

Permalink
Add additional test
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Jul 27, 2023
1 parent bf38111 commit ea2f8b3
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.rs
Original file line number Diff line number Diff line change
@@ -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() {}
33 changes: 33 additions & 0 deletions tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.stderr
Original file line number Diff line number Diff line change
@@ -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`.

0 comments on commit ea2f8b3

Please sign in to comment.