]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/issue-62506-two_awaits.rs
Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser
[rust.git] / src / test / ui / generator / issue-62506-two_awaits.rs
1 // Output = String caused an ICE whereas Output = &'static str compiled successfully.
2 // Broken MIR: generator contains type std::string::String in MIR,
3 // but typeck only knows about {<S as T>::Future, ()}
4 // check-pass
5 // edition:2018
6
7 use std::future::Future;
8
9 pub trait T {
10     type Future: Future<Output = String>;
11     fn bar() -> Self::Future;
12 }
13 pub async fn foo<S>() where S: T {
14     S::bar().await;
15     S::bar().await;
16 }
17 pub fn main() {}