Rollup merge of #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 #114121
This commit is contained in:
commit
218e88e5d8
2 changed files with 25 additions and 6 deletions
16
tests/ui/type-alias-impl-trait/broken_mir.rs
Normal file
16
tests/ui/type-alias-impl-trait/broken_mir.rs
Normal file
|
|
@ -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![])
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue