Test case for #62506.
This commit is contained in:
parent
b8ec4c4d11
commit
387b6c3e78
18
src/test/ui/generator/issue-62506-two_awaits.rs
Normal file
18
src/test/ui/generator/issue-62506-two_awaits.rs
Normal file
@ -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 {<S as T>::Future, ()}
|
||||
// check-pass
|
||||
// edition:2018
|
||||
|
||||
#![feature(async_await)]
|
||||
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() {}
|
Loading…
Reference in New Issue
Block a user