]> git.lizzy.rs Git - rust.git/blob - tests/ui/generator/issue-62506-two_awaits.rs
Rollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
[rust.git] / tests / 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() {}