Skip to content

Commit 155857f

Browse files
committed
Revise error message to use phrase "all caps" instead of "uppercase".
This is to clarify that the lint is checking for THIS_THING and not This.
1 parent 8d6f4c2 commit 155857f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/librustc/middle/check_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pub fn check_arms(cx: &MatchCheckCtxt, arms: &[Arm]) {
137137

138138
// Lint for constants that look like binding identifiers (#7526)
139139
let pat_matches_non_uppercase_static: &fn(@Pat) = |p| {
140-
let msg = "static constant in pattern should have an uppercase identifier";
140+
let msg = "static constant in pattern should be all caps";
141141
match (&p.node, cx.tcx.def_map.find(&p.id)) {
142142
(&PatIdent(_, ref path, _), Some(&DefStatic(_, false))) => {
143143
// last identifier alone is right choice for this lint.

src/librustc/middle/lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static lint_table: &'static [(&'static str, LintSpec)] = &[
213213
("non_uppercase_pattern_statics",
214214
LintSpec {
215215
lint: non_uppercase_pattern_statics,
216-
desc: "static constants in match patterns should be uppercased",
216+
desc: "static constants in match patterns should be all caps",
217217
default: warn
218218
}),
219219

src/test/compile-fail/match-static-const-lc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub static a : int = 97;
1717
fn f() {
1818
let r = match (0,0) {
1919
(0, a) => 0,
20-
//~^ ERROR static constant in pattern should have an uppercase id
20+
//~^ ERROR static constant in pattern should be all caps
2121
(x, y) => 1 + x + y,
2222
};
2323
assert!(r == 1);
@@ -31,7 +31,7 @@ fn g() {
3131
use m::aha;
3232
let r = match (0,0) {
3333
(0, aha) => 0,
34-
//~^ ERROR static constant in pattern should have an uppercase id
34+
//~^ ERROR static constant in pattern should be all caps
3535
(x, y) => 1 + x + y,
3636
};
3737
assert!(r == 1);

0 commit comments

Comments
 (0)