From 727e20410c61293f38b7f7984a469dc7daad632a Mon Sep 17 00:00:00 2001 From: varkor Date: Sat, 16 Feb 2019 13:04:15 +0000 Subject: [PATCH] Add a test for const parameter uppercase lint --- .../const-parameter-uppercase-lint.rs | 8 ++++++++ .../const-parameter-uppercase-lint.stderr | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/test/ui/const-generics/const-parameter-uppercase-lint.rs create mode 100644 src/test/ui/const-generics/const-parameter-uppercase-lint.stderr diff --git a/src/test/ui/const-generics/const-parameter-uppercase-lint.rs b/src/test/ui/const-generics/const-parameter-uppercase-lint.rs new file mode 100644 index 000000000000..37fe9af98b3d --- /dev/null +++ b/src/test/ui/const-generics/const-parameter-uppercase-lint.rs @@ -0,0 +1,8 @@ +#![feature(const_generics)] +//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash + +#![deny(non_upper_case_globals)] + +fn noop() { + //~^ ERROR const generics in any position are currently unsupported +} diff --git a/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr b/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr new file mode 100644 index 000000000000..9683e91cef30 --- /dev/null +++ b/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr @@ -0,0 +1,19 @@ +warning: the feature `const_generics` is incomplete and may cause the compiler to crash + --> $DIR/const-parameter-uppercase-lint.rs:1:12 + | +LL | #![feature(const_generics)] + | ^^^^^^^^^^^^^^ + +error[E0601]: `main` function not found in crate `const_parameter_uppercase_lint` + | + = note: consider adding a `main` function to `$DIR/const-parameter-uppercase-lint.rs` + +error: const generics in any position are currently unsupported + --> $DIR/const-parameter-uppercase-lint.rs:6:15 + | +LL | fn noop() { + | ^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0601`.