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 { 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`.