Skip to content

Commit ea2f8b3

Browse files
Add additional test
1 parent bf38111 commit ea2f8b3

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// issue: 114146
2+
3+
#![feature(return_position_impl_trait_in_trait)]
4+
5+
trait Foo {
6+
fn bar<'other: 'a>() -> impl Sized + 'a {}
7+
//~^ ERROR use of undeclared lifetime name `'a`
8+
//~| ERROR use of undeclared lifetime name `'a`
9+
}
10+
11+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
error[E0261]: use of undeclared lifetime name `'a`
2+
--> $DIR/bad-item-bound-within-rpitit-2.rs:6:20
3+
|
4+
LL | fn bar<'other: 'a>() -> impl Sized + 'a {}
5+
| ^^ undeclared lifetime
6+
|
7+
help: consider introducing lifetime `'a` here
8+
|
9+
LL | fn bar<'a, 'other: 'a>() -> impl Sized + 'a {}
10+
| +++
11+
help: consider introducing lifetime `'a` here
12+
|
13+
LL | trait Foo<'a> {
14+
| ++++
15+
16+
error[E0261]: use of undeclared lifetime name `'a`
17+
--> $DIR/bad-item-bound-within-rpitit-2.rs:6:42
18+
|
19+
LL | fn bar<'other: 'a>() -> impl Sized + 'a {}
20+
| ^^ undeclared lifetime
21+
|
22+
help: consider introducing lifetime `'a` here
23+
|
24+
LL | fn bar<'a, 'other: 'a>() -> impl Sized + 'a {}
25+
| +++
26+
help: consider introducing lifetime `'a` here
27+
|
28+
LL | trait Foo<'a> {
29+
| ++++
30+
31+
error: aborting due to 2 previous errors
32+
33+
For more information about this error, try `rustc --explain E0261`.

0 commit comments

Comments
 (0)