-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turns out opaque types can have hidden types registered during mir va…
…lidation
- Loading branch information
Showing
2 changed files
with
25 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! ICE: https://github.com/rust-lang/rust/issues/114121 | ||
//! This test checks that MIR validation never constrains | ||
//! new hidden types that *differ* from the actual hidden types. | ||
//! This test used to ICE because oli-obk assumed mir validation | ||
//! was only ever run after opaque types were revealed in MIR. | ||
|
||
// compile-flags: -Zvalidate-mir | ||
// check-pass | ||
|
||
fn main() { | ||
let _ = Some(()).into_iter().flat_map(|_| Some(()).into_iter().flat_map(func)); | ||
} | ||
|
||
fn func(_: ()) -> impl Iterator<Item = ()> { | ||
Some(()).into_iter().flat_map(|_| vec![]) | ||
} |