-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf38111
commit ea2f8b3
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
33
tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |