diff --git a/src/test/ui/generator/issue-62506-two_awaits.rs b/src/test/ui/generator/issue-62506-two_awaits.rs new file mode 100644 index 00000000000..774019b6a5b --- /dev/null +++ b/src/test/ui/generator/issue-62506-two_awaits.rs @@ -0,0 +1,18 @@ +// 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 {::Future, ()} +// check-pass +// edition:2018 + +#![feature(async_await)] +use std::future::Future; + +pub trait T { + type Future: Future; + fn bar() -> Self::Future; +} +pub async fn foo() where S: T { + S::bar().await; + S::bar().await; +} +pub fn main() {}