diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2025-08-10 15:43:52 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-10 15:43:52 -0400 |
| commit | 5bd4e832d3608a4b06e3bc0b0bf348e664e961ec (patch) | |
| tree | 7c1d1b40c6f63cb455a916c690f9f1d7cb8a27b1 /tests/ui/pattern | |
| parent | 18eeac04fc5c2a4c4a8020dbdf1c652077ad0e4e (diff) | |
| parent | aa543963c68061d9ca46037071d66a028626ff3f (diff) | |
| download | rust-5bd4e832d3608a4b06e3bc0b0bf348e664e961ec.tar.gz rust-5bd4e832d3608a4b06e3bc0b0bf348e664e961ec.zip | |
Rollup merge of #144553 - Oneirical:uncountable-integer-4, r=jieyouxu
Rehome 32 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` rust-lang/rust#143902 divided into smaller, easier to review chunks. Part of rust-lang/rust#133895 Methodology: 1. Refer to the previously written `tests/ui/SUMMARY.md` 2. Find an appropriate category for the test, using the original issue thread and the test contents. 3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers) 4. Rename the tests to make their purpose clearer Inspired by the methodology that `@Kivooeo` was using. r? `@jieyouxu`
Diffstat (limited to 'tests/ui/pattern')
| -rw-r--r-- | tests/ui/pattern/unit-variant-pattern-matching-29383.rs | 15 | ||||
| -rw-r--r-- | tests/ui/pattern/unit-variant-pattern-matching-29383.stderr | 21 |
2 files changed, 36 insertions, 0 deletions
diff --git a/tests/ui/pattern/unit-variant-pattern-matching-29383.rs b/tests/ui/pattern/unit-variant-pattern-matching-29383.rs new file mode 100644 index 00000000000..e339dc01f46 --- /dev/null +++ b/tests/ui/pattern/unit-variant-pattern-matching-29383.rs @@ -0,0 +1,15 @@ +// https://github.com/rust-lang/rust/issues/29383 +enum E { + A, + B, +} + +fn main() { + match None { + None => {} + Some(E::A(..)) => {} + //~^ ERROR expected tuple struct or tuple variant, found unit variant `E::A` + Some(E::B(..)) => {} + //~^ ERROR expected tuple struct or tuple variant, found unit variant `E::B` + } +} diff --git a/tests/ui/pattern/unit-variant-pattern-matching-29383.stderr b/tests/ui/pattern/unit-variant-pattern-matching-29383.stderr new file mode 100644 index 00000000000..e30837568a5 --- /dev/null +++ b/tests/ui/pattern/unit-variant-pattern-matching-29383.stderr @@ -0,0 +1,21 @@ +error[E0532]: expected tuple struct or tuple variant, found unit variant `E::A` + --> $DIR/unit-variant-pattern-matching-29383.rs:10:14 + | +LL | A, + | - `E::A` defined here +... +LL | Some(E::A(..)) => {} + | ^^^^^^^^ help: use this syntax instead: `E::A` + +error[E0532]: expected tuple struct or tuple variant, found unit variant `E::B` + --> $DIR/unit-variant-pattern-matching-29383.rs:12:14 + | +LL | B, + | - `E::B` defined here +... +LL | Some(E::B(..)) => {} + | ^^^^^^^^ help: use this syntax instead: `E::B` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0532`. |
