Skip to content

Commit 387b6c3

Browse files
committed
Test case for rust-lang#62506.
1 parent b8ec4c4 commit 387b6c3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
#![feature(async_await)]
8+
use std::future::Future;
9+
10+
pub trait T {
11+
type Future: Future<Output = String>;
12+
fn bar() -> Self::Future;
13+
}
14+
pub async fn foo<S>() where S: T {
15+
S::bar().await;
16+
S::bar().await;
17+
}
18+
pub fn main() {}

0 commit comments

Comments
 (0)