Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`.