Skip to content

Commit

Permalink
Rollup merge of rust-lang#113164 - JohnTitor:issue-109054, r=compiler…
Browse files Browse the repository at this point in the history
…-errors

Add a regression test for rust-lang#109054

Closes rust-lang#109054
r? `@compiler-errors`
  • Loading branch information
matthiaskrgr committed Jul 6, 2023
2 parents 8724995 + 86728e7 commit f1418ea
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/ui/type-alias-impl-trait/issue-109054.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// edition:2021

#![feature(type_alias_impl_trait)]

struct CallMe;

type ReturnType<'a> = impl std::future::Future<Output = u32> + 'a;
type FnType = impl Fn(&u32) -> ReturnType;

impl std::ops::Deref for CallMe {
type Target = FnType;

fn deref(&self) -> &Self::Target {
fn inner(val: &u32) -> ReturnType {
async move { *val * 2 }
}

&inner //~ ERROR: expected generic lifetime parameter, found `'_`
}
}

fn main() {}
12 changes: 12 additions & 0 deletions tests/ui/type-alias-impl-trait/issue-109054.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E0792]: expected generic lifetime parameter, found `'_`
--> $DIR/issue-109054.rs:18:9
|
LL | type ReturnType<'a> = impl std::future::Future<Output = u32> + 'a;
| -- this generic parameter must be used with a generic lifetime parameter
...
LL | &inner
| ^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0792`.

0 comments on commit f1418ea

Please sign in to comment.