File tree 2 files changed +34
-0
lines changed
tests/ui/type-alias-impl-trait
2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ // edition:2021
2
+
3
+ #![ feature( type_alias_impl_trait) ]
4
+
5
+ struct CallMe ;
6
+
7
+ type ReturnType < ' a > = impl std:: future:: Future < Output = u32 > + ' a ;
8
+ type FnType = impl Fn ( & u32 ) -> ReturnType ;
9
+
10
+ impl std:: ops:: Deref for CallMe {
11
+ type Target = FnType ;
12
+
13
+ fn deref ( & self ) -> & Self :: Target {
14
+ fn inner ( val : & u32 ) -> ReturnType {
15
+ async move { * val * 2 }
16
+ }
17
+
18
+ & inner //~ ERROR: expected generic lifetime parameter, found `'_`
19
+ }
20
+ }
21
+
22
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error[E0792]: expected generic lifetime parameter, found `'_`
2
+ --> $DIR/issue-109054.rs:18:9
3
+ |
4
+ LL | type ReturnType<'a> = impl std::future::Future<Output = u32> + 'a;
5
+ | -- this generic parameter must be used with a generic lifetime parameter
6
+ ...
7
+ LL | &inner
8
+ | ^^^^^^
9
+
10
+ error: aborting due to previous error
11
+
12
+ For more information about this error, try `rustc --explain E0792`.
You can’t perform that action at this time.
0 commit comments