Skip to content

Commit 1cb31e7

Browse files
Rollup merge of #113164 - JohnTitor:issue-109054, r=compiler-errors
Add a regression test for #109054 Closes #109054 r? ``@compiler-errors``
2 parents de49a9f + 86728e7 commit 1cb31e7

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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`.

0 commit comments

Comments
 (0)