Skip to content

Commit 066d62d

Browse files
committed
Use one message for uppercase global lint
1 parent 72399f2 commit 066d62d

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/librustc_lint/bad_style.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,7 @@ impl LintPass for NonUpperCaseGlobals {
355355
impl LateLintPass for NonUpperCaseGlobals {
356356
fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
357357
match it.node {
358-
hir::ItemStatic(_, hir::MutImmutable, _) => {
359-
NonUpperCaseGlobals::check_upper_case(cx, "static constant", it.name, it.span);
360-
}
361-
hir::ItemStatic(_, hir::MutMutable, _) => {
358+
hir::ItemStatic(..) => {
362359
NonUpperCaseGlobals::check_upper_case(cx, "static variable", it.name, it.span);
363360
}
364361
hir::ItemConst(..) => {

src/test/compile-fail/lint-group-style.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ mod test {
2424
mod bad {
2525
fn CamelCase() {} //~ ERROR function `CamelCase` should have a snake case name
2626

27-
static bad: isize = 1; //~ ERROR static constant `bad` should have an upper case name
27+
static bad: isize = 1; //~ ERROR static variable `bad` should have an upper case name
2828
}
2929

3030
mod warn {

src/test/compile-fail/lint-non-uppercase-statics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![forbid(non_upper_case_globals)]
1212
#![allow(dead_code)]
1313

14-
static foo: isize = 1; //~ ERROR static constant `foo` should have an upper case name such as `FOO`
14+
static foo: isize = 1; //~ ERROR static variable `foo` should have an upper case name such as `FOO`
1515

1616
static mut bar: isize = 1;
1717
//~^ ERROR static variable `bar` should have an upper case name such as `BAR`

0 commit comments

Comments
 (0)