about summary refs log tree commit diff
path: root/tests/ui/pattern/normalize-ty-in-range.rs
blob: f0d22362608e19de3891766160cac01c0dbbbc64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//@ 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 => {}
        _ => {}
    }
}