File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
tests/ui/impl-trait/in-trait Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 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 number Diff line number Diff line change 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`.
You can’t perform that action at this time.
0 commit comments