Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 2783f1b

Browse files
committed
Add ty::Opaque ICE reproducer
1 parent 4e4a929 commit 2783f1b

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

tests/ui/type-alias-impl-trait/issue-96572-unconstrained.rs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ fn upvar() {
2626
fn enum_upvar() {
2727
type T = impl Copy;
2828
let foo: T = Some((1u32, 2u32));
29-
let x = move || {
30-
match foo {
31-
None => (),
32-
Some((a, b)) => (),
33-
}
29+
let x = move || match foo {
30+
None => (),
31+
Some((a, b)) => (),
3432
};
3533
}
3634

@@ -63,6 +61,18 @@ mod only_pattern {
6361
None => {}
6462
}
6563
}
64+
65+
type V = impl Copy;
66+
67+
fn baz(baz: Option<V>) {
68+
match baz {
69+
_ => {}
70+
Some((mut x, mut y)) => {
71+
x = 42;
72+
y = "foo";
73+
}
74+
}
75+
}
6676
}
6777

6878
mod only_pattern_rpit {
@@ -71,11 +81,7 @@ mod only_pattern_rpit {
7181
let (mut x, mut y) = foo(false);
7282
x = 42;
7383
y = "foo";
74-
if b {
75-
panic!()
76-
} else {
77-
foo(true)
78-
}
84+
if b { panic!() } else { foo(true) }
7985
}
8086

8187
fn bar(b: bool) -> Option<impl Copy> {

0 commit comments

Comments
 (0)