diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2025-08-10 19:45:48 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-10 19:45:48 +1000 |
| commit | 62b406d4b185f28828df3e0df6b1aa1f560145df (patch) | |
| tree | a3720e028c717f4136e1e555311c436c2a84aeb0 /tests/ui/pattern/enum-struct-pattern-mismatch-15896.rs | |
| parent | 5955f005e53234b71f77d33040b973e6b9551db3 (diff) | |
| parent | 16765639b30741dde85da0dbcb44c343eb82b1a2 (diff) | |
| download | rust-62b406d4b185f28828df3e0df6b1aa1f560145df.tar.gz rust-62b406d4b185f28828df3e0df6b1aa1f560145df.zip | |
Rollup merge of #144403 - Kivooeo:issue4, r=jieyouxu
`tests/ui/issues/`: The Issues Strike Back [4/N] Some `tests/ui/issues/` housekeeping, to trim down number of tests directly under `tests/ui/issues/`. Part of https://github.com/rust-lang/rust/issues/133895. r? ````````@jieyouxu````````
Diffstat (limited to 'tests/ui/pattern/enum-struct-pattern-mismatch-15896.rs')
| -rw-r--r-- | tests/ui/pattern/enum-struct-pattern-mismatch-15896.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/pattern/enum-struct-pattern-mismatch-15896.rs b/tests/ui/pattern/enum-struct-pattern-mismatch-15896.rs new file mode 100644 index 00000000000..9f7c5084c0e --- /dev/null +++ b/tests/ui/pattern/enum-struct-pattern-mismatch-15896.rs @@ -0,0 +1,17 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/15896 + +// Regression test for #15896. It used to ICE rustc. + +fn main() { + enum R { REB(()) } + struct Tau { t: usize } + enum E { B(R, Tau) } + + let e = E::B(R::REB(()), Tau { t: 3 }); + let u = match e { + E::B( + Tau{t: x}, + //~^ ERROR mismatched types + _) => x, + }; +} |
