forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#62777 - gilescope:self-referencial-to-recur…
…sion, r=eddyb Self-referencial type now called a recursive type As per Boat's suggestion - rust-lang#62539, this makes the error message clearer.
- Loading branch information
Showing
5 changed files
with
36 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters