diff options
| author | Giles Cope <gilescope@gmail.com> | 2019-07-17 18:31:25 +0100 |
|---|---|---|
| committer | Giles Cope <gilescope@gmail.com> | 2019-07-17 21:38:08 +0100 |
| commit | 387b6c3e782e61f979083ff960e6e18fcaa1fe2c (patch) | |
| tree | 7e5b2488042aac5f6c635968dcabef214c1ef7be /src | |
| parent | b8ec4c4d11ede0fba333a0474ed473dbe82aacf1 (diff) | |
| download | rust-387b6c3e782e61f979083ff960e6e18fcaa1fe2c.tar.gz rust-387b6c3e782e61f979083ff960e6e18fcaa1fe2c.zip | |
Test case for #62506.
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/generator/issue-62506-two_awaits.rs | 18 |
1 files changed, 18 insertions, 0 deletions
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 {<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() {} |
