From 9af6ee50ed8630590ed02ca1c284d07b65d84d10 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 8 May 2025 15:00:11 +0000 Subject: Structurally resolve in check_ref_cast and calc_adjust_mode --- tests/ui/pattern/normalize-ty-in-range.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/ui/pattern/normalize-ty-in-range.rs (limited to 'tests') diff --git a/tests/ui/pattern/normalize-ty-in-range.rs b/tests/ui/pattern/normalize-ty-in-range.rs new file mode 100644 index 00000000000..f0d22362608 --- /dev/null +++ b/tests/ui/pattern/normalize-ty-in-range.rs @@ -0,0 +1,24 @@ +//@ check-pass +//@ revisions: current next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver + +// Regression test for . +// 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 => {} + _ => {} + } +} -- cgit 1.4.1-3-g733a5