diff options
| author | bors <bors@rust-lang.org> | 2013-07-03 04:31:50 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-07-03 04:31:50 -0700 |
| commit | 55f155521d2f604794d2ab1de2a8d439440af4a8 (patch) | |
| tree | 69ef091fd4237ad3109b7e05e99421b97a576b0f /src/libsyntax | |
| parent | 6caaa34dedc45543e4d2c7600f952e042d9258df (diff) | |
| parent | c437a16c5d8c00b39dc6c5e36011def997d77224 (diff) | |
| download | rust-55f155521d2f604794d2ab1de2a8d439440af4a8.tar.gz rust-55f155521d2f604794d2ab1de2a8d439440af4a8.zip | |
auto merge of #7523 : huonw/rust/uppercase-statics-lint, r=cmr
Adds a lint for `static some_lowercase_name: uint = 1;`. Warning by default since it causes confusion, e.g. `static a: uint = 1; ... let a = 2;` => `error: only refutable patterns allowed here`.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/diagnostic.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/syntax.rs | 1 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index ab7d3fda501..204028212d6 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -179,10 +179,10 @@ fn diagnosticstr(lvl: level) -> ~str { fn diagnosticcolor(lvl: level) -> term::color::Color { match lvl { - fatal => term::color::bright_red, - error => term::color::bright_red, - warning => term::color::bright_yellow, - note => term::color::bright_green + fatal => term::color::BRIGHT_RED, + error => term::color::BRIGHT_RED, + warning => term::color::BRIGHT_YELLOW, + note => term::color::BRIGHT_GREEN } } diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 15f915ba4d8..a78a18810a8 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -580,6 +580,7 @@ pub fn core_macros() -> @str { pub mod $c { fn key(_x: @::std::condition::Handler<$in,$out>) { } + #[allow(non_uppercase_statics)] pub static cond : ::std::condition::Condition<'static,$in,$out> = ::std::condition::Condition { @@ -595,6 +596,7 @@ pub fn core_macros() -> @str { pub mod $c { fn key(_x: @::std::condition::Handler<$in,$out>) { } + #[allow(non_uppercase_statics)] pub static cond : ::std::condition::Condition<'static,$in,$out> = ::std::condition::Condition { diff --git a/src/libsyntax/syntax.rs b/src/libsyntax/syntax.rs index 830ca569455..52ed49ea1ea 100644 --- a/src/libsyntax/syntax.rs +++ b/src/libsyntax/syntax.rs @@ -21,6 +21,7 @@ #[crate_type = "lib"]; #[allow(non_camel_case_types)]; +#[allow(non_uppercase_statics)]; #[deny(deprecated_pattern)]; extern mod extra; |
