summaryrefslogtreecommitdiffstats
path: root/tests/ui/coroutine/issue-62506-two_awaits.rs
blob: b50e2a45c588f2eaea1bfc36e66e76adc1f74ae3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Output = String caused an ICE whereas Output = &'static str compiled successfully.
// Broken MIR: coroutine contains type std::string::String in MIR,
// but typeck only knows about {<S as T>::Future, ()}
// check-pass
// edition:2018

use std::future::Future;

pub trait T {
    type Future: Future<Output = String>;
    fn bar() -> Self::Future;
}
pub async fn foo<S>() where S: T {
    S::bar().await;
    S::bar().await;
}
pub fn main() {}