about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-05-08 15:00:11 +0000
committerMichael Goulet <michael@errs.io>2025-05-08 15:00:17 +0000
commit9af6ee50ed8630590ed02ca1c284d07b65d84d10 (patch)
treecacb538bf714e720b4fe832f222fff14e90eed92 /tests
parent19738720130a82959acd4fc45259166262f3ffbe (diff)
downloadrust-9af6ee50ed8630590ed02ca1c284d07b65d84d10.tar.gz
rust-9af6ee50ed8630590ed02ca1c284d07b65d84d10.zip
Structurally resolve in check_ref_cast and calc_adjust_mode
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/pattern/normalize-ty-in-range.rs24
1 files changed, 24 insertions, 0 deletions
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 <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 => {}
+        _ => {}
+    }
+}