diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/async-await/issue-74497-lifetime-in-opaque.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/async-await/issue-74497-lifetime-in-opaque.rs b/src/test/ui/async-await/issue-74497-lifetime-in-opaque.rs new file mode 100644 index 000000000..2d765eb41 --- /dev/null +++ b/src/test/ui/async-await/issue-74497-lifetime-in-opaque.rs @@ -0,0 +1,19 @@ +// edition:2018 + +// test that names give to anonymous lifetimes in opaque types like `impl Future` are correctly +// introduced in error messages + +use std::future::Future; + +pub async fn foo<F, T>(_: F) +where + F: Fn(&u8) -> T, + T: Future<Output = ()>, +{ +} + +pub async fn bar(_: &u8) {} + +fn main() { + let _ = foo(|x| bar(x)); //~ ERROR lifetime may not live long enough +} |