]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-trait/issue-103181-2.rs
Auto merge of #106171 - compiler-errors:consolidate-extract_callable_info, r=estebank...
[rust.git] / tests / ui / impl-trait / issue-103181-2.rs
1 // edition:2021
2
3 trait SendFuture: Send {
4     type Output;
5 }
6
7 impl<Fut: Send> SendFuture for Fut {
8     type Output = ();
9 }
10
11 async fn broken_fut() {
12     ident_error;
13     //~^ ERROR cannot find value `ident_error` in this scope
14 }
15
16 // triggers normalization of `<Fut as SendFuture>::Output`,
17 // which requires `Fut: Send`.
18 fn normalize<Fut: SendFuture>(_: Fut, _: Fut::Output) {}
19
20 async fn iceice<A, B>()
21 // <- async fn is necessary
22 where
23     A: Send,
24     B: Send, // <- a second bound
25 {
26     normalize(broken_fut(), ());
27 }
28
29 fn main() {}