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#114123 - oli-obk:tait_wtf, r=WaffleLapkin
Turns out opaque types can have hidden types registered during mir validation See the newly added test's documentation for an explanation. fixes rust-lang#114121
- 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![]) | ||
} |