rust/tests/ui/generator/issue-62506-two_awaits.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
446 B
Rust
Raw Normal View History

2019-07-17 17:31:25 +00:00
// Output = String caused an ICE whereas Output = &'static str compiled successfully.
// Broken MIR: generator 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() {}