-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test for const parameter uppercase lint
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
19
src/test/ui/const-generics/const-parameter-uppercase-lint.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |