rust/tests/ui/pattern/normalize-ty-in-range.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
496 B
Rust
Raw Normal View History

//@ check-pass
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
// Regression test for <https://github.com/rust-lang/trait-system-refactor-initiative/issues/200>.
// Make sure we structurally normalize in range pattern checking in HIR typeck.
trait Foo {
type Bar;
}
impl Foo for () {
type Bar = i32;
}
fn main() {
const X: <() as Foo>::Bar = 0;
match 0 {
X..=X => {}
_ => {}
}
}