diff options
| author | varkor <github@varkor.com> | 2019-02-16 13:04:15 +0000 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-02-16 13:04:15 +0000 |
| commit | 727e20410c61293f38b7f7984a469dc7daad632a (patch) | |
| tree | 99bd3fd6cc8387fc3e7f02adabb7b4499dc84e22 | |
| parent | 425fb58cacb9dbded92e46ee1bdeaa9dda4a219e (diff) | |
| download | rust-727e20410c61293f38b7f7984a469dc7daad632a.tar.gz rust-727e20410c61293f38b7f7984a469dc7daad632a.zip | |
Add a test for const parameter uppercase lint
| -rw-r--r-- | src/test/ui/const-generics/const-parameter-uppercase-lint.rs | 8 | ||||
| -rw-r--r-- | src/test/ui/const-generics/const-parameter-uppercase-lint.stderr | 19 |
2 files changed, 27 insertions, 0 deletions
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 00000000000..37fe9af98b3 --- /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<const x: u32>() { + //~^ 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 00000000000..9683e91cef3 --- /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<const x: u32>() { + | ^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0601`. |
