diff options
| author | P1start <rewi-github@whanau.org> | 2014-09-13 13:55:37 +1200 |
|---|---|---|
| committer | P1start <rewi-github@whanau.org> | 2014-10-03 20:39:56 +1300 |
| commit | 94bcd3539c761b4ecf423800bce21057c4e961fa (patch) | |
| tree | 51c0030bfc0a527ce57da49f0987f726ea0ed912 /src/libstd | |
| parent | aa034cd3bac3155e0f6c74c399314b5ee32f88fc (diff) | |
| download | rust-94bcd3539c761b4ecf423800bce21057c4e961fa.tar.gz rust-94bcd3539c761b4ecf423800bce21057c4e961fa.zip | |
Set the `non_uppercase_statics` lint to warn by default
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/bitflags.rs | 10 | ||||
| -rw-r--r-- | src/libstd/io/process.rs | 1 | ||||
| -rw-r--r-- | src/libstd/macros.rs | 2 | ||||
| -rw-r--r-- | src/libstd/path/posix.rs | 2 | ||||
| -rw-r--r-- | src/libstd/task.rs | 4 |
5 files changed, 15 insertions, 4 deletions
diff --git a/src/libstd/bitflags.rs b/src/libstd/bitflags.rs index 1d479b85248..391d099de87 100644 --- a/src/libstd/bitflags.rs +++ b/src/libstd/bitflags.rs @@ -123,7 +123,10 @@ macro_rules! bitflags { bits: $T, } - $($(#[$Flag_attr])* pub static $Flag: $BitFlags = $BitFlags { bits: $value };)+ + $( + #[allow(non_uppercase_statics)] + $(#[$Flag_attr])* pub static $Flag: $BitFlags = $BitFlags { bits: $value }; + )+ impl $BitFlags { /// Returns an empty set of flags. @@ -240,7 +243,10 @@ macro_rules! bitflags { bitflags! { $(#[$attr])* flags $BitFlags: $T { - $($(#[$Flag_attr])* static $Flag = $value),+ + $( + #[allow(non_uppercase_statics)] + $(#[$Flag_attr])* static $Flag = $value + ),+ } } }; diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs index d8be92e4514..73a8aa442c1 100644 --- a/src/libstd/io/process.rs +++ b/src/libstd/io/process.rs @@ -11,6 +11,7 @@ //! Bindings for executing child processes #![allow(experimental)] +#![allow(non_uppercase_statics)] use prelude::*; diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index d949a03dfc1..fa356432a67 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -304,9 +304,11 @@ macro_rules! println( #[macro_export] macro_rules! local_data_key( ($name:ident: $ty:ty) => ( + #[allow(non_uppercase_statics)] static $name: ::std::local_data::Key<$ty> = &::std::local_data::KeyValueKey; ); (pub $name:ident: $ty:ty) => ( + #[allow(non_uppercase_statics)] pub static $name: ::std::local_data::Key<$ty> = &::std::local_data::KeyValueKey; ); ) diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs index 9c4139853c5..805db000686 100644 --- a/src/libstd/path/posix.rs +++ b/src/libstd/path/posix.rs @@ -457,7 +457,9 @@ fn normalize_helper<'a>(v: &'a [u8], is_abs: bool) -> Option<Vec<&'a [u8]>> { } } +#[allow(non_uppercase_statics)] static dot_static: &'static [u8] = b"."; +#[allow(non_uppercase_statics)] static dot_dot_static: &'static [u8] = b".."; #[cfg(test)] diff --git a/src/libstd/task.rs b/src/libstd/task.rs index 9cace9c80ef..977b3018fa7 100644 --- a/src/libstd/task.rs +++ b/src/libstd/task.rs @@ -569,10 +569,10 @@ mod test { // climbing the task tree to dereference each ancestor. (See #1789) // (well, it would if the constant were 8000+ - I lowered it to be more // valgrind-friendly. try this at home, instead..!) - static generations: uint = 16; + static GENERATIONS: uint = 16; fn child_no(x: uint) -> proc(): Send { return proc() { - if x < generations { + if x < GENERATIONS { TaskBuilder::new().spawn(child_no(x+1)); } } |
