Skip to content

Commit

Permalink
Add a test for const parameter uppercase lint
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Feb 16, 2019
1 parent 425fb58 commit 727e204
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/test/ui/const-generics/const-parameter-uppercase-lint.rs
Original file line number Diff line number Diff line change
@@ -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
}
19 changes: 19 additions & 0 deletions src/test/ui/const-generics/const-parameter-uppercase-lint.stderr
Original file line number Diff line number Diff line change
@@ -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`.

0 comments on commit 727e204

Please sign in to comment.