diff options
| author | Michael Goulet <michael@errs.io> | 2024-04-14 10:51:25 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-04-15 18:48:12 -0400 |
| commit | 9d72808b1ea383628fcee2c09441bfce7c73ef51 (patch) | |
| tree | 1b1c3227c87dd612277ecb21c9b4d851019a424d | |
| parent | 619e0441784126defd42454ec1949e0a4dd0e4fa (diff) | |
| download | rust-9d72808b1ea383628fcee2c09441bfce7c73ef51.tar.gz rust-9d72808b1ea383628fcee2c09441bfce7c73ef51.zip | |
Add test
| -rw-r--r-- | tests/ui/enum/error-variant-with-turbofishes.rs | 8 | ||||
| -rw-r--r-- | tests/ui/enum/error-variant-with-turbofishes.stderr | 9 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/enum/error-variant-with-turbofishes.rs b/tests/ui/enum/error-variant-with-turbofishes.rs new file mode 100644 index 00000000000..a58d24ce20a --- /dev/null +++ b/tests/ui/enum/error-variant-with-turbofishes.rs @@ -0,0 +1,8 @@ +enum Struct<const N: usize> { Variant { x: [(); N] } } + +fn test() { + let x = Struct::<0>::Variant; + //~^ ERROR expected value, found struct variant `Struct<0>::Variant` +} + +fn main() {} diff --git a/tests/ui/enum/error-variant-with-turbofishes.stderr b/tests/ui/enum/error-variant-with-turbofishes.stderr new file mode 100644 index 00000000000..66bed1c0d85 --- /dev/null +++ b/tests/ui/enum/error-variant-with-turbofishes.stderr @@ -0,0 +1,9 @@ +error[E0533]: expected value, found struct variant `Struct<0>::Variant` + --> $DIR/error-variant-with-turbofishes.rs:4:13 + | +LL | let x = Struct::<0>::Variant; + | ^^^^^^^^^^^^^^^^^^^^ not a value + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0533`. |
