]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issue-74497-lifetime-in-opaque.rs
Rollup merge of #107061 - compiler-errors:new-solver-new-candidates-3, r=lcnr
[rust.git] / tests / ui / async-await / issue-74497-lifetime-in-opaque.rs
1 // edition:2018
2
3 // test that names give to anonymous lifetimes in opaque types like `impl Future` are correctly
4 // introduced in error messages
5
6 use std::future::Future;
7
8 pub async fn foo<F, T>(_: F)
9 where
10     F: Fn(&u8) -> T,
11     T: Future<Output = ()>,
12 {
13 }
14
15 pub async fn bar(_: &u8) {}
16
17 fn main() {
18     let _ = foo(|x| bar(x)); //~ ERROR lifetime may not live long enough
19 }