about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-10-17 04:32:15 -0700
committerGitHub <noreply@github.com>2016-10-17 04:32:15 -0700
commit07b86d0d4d41976f52aa318960e605534ee42d4f (patch)
tree411b4c9dade7d519fa31f35aab7180a69725f8d5 /src/libstd/sync
parentda7f8c540b47c5bb063356bf5ad05a6a49ed0ff1 (diff)
parent066d62d4b4d508f7a46d773c9100dc6516ac34f6 (diff)
downloadrust-07b86d0d4d41976f52aa318960e605534ee42d4f.tar.gz
rust-07b86d0d4d41976f52aa318960e605534ee42d4f.zip
Auto merge of #37162 - matklad:static-mut-lint, r=jseyfried
Lint against lowercase static mut

Closes #37145.

Lint for non mut statics was added in https://github.com/rust-lang/rust/pull/7523, and it explicitly did not cover mut statics. I am not sure why.
Diffstat (limited to 'src/libstd/sync')
-rw-r--r--src/libstd/sync/once.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs
index ad9d0b37544..71e163321ae 100644
--- a/src/libstd/sync/once.rs
+++ b/src/libstd/sync/once.rs
@@ -387,7 +387,7 @@ mod tests {
     #[test]
     fn stampede_once() {
         static O: Once = Once::new();
-        static mut run: bool = false;
+        static mut RUN: bool = false;
 
         let (tx, rx) = channel();
         for _ in 0..10 {
@@ -396,10 +396,10 @@ mod tests {
                 for _ in 0..4 { thread::yield_now() }
                 unsafe {
                     O.call_once(|| {
-                        assert!(!run);
-                        run = true;
+                        assert!(!RUN);
+                        RUN = true;
                     });
-                    assert!(run);
+                    assert!(RUN);
                 }
                 tx.send(()).unwrap();
             });
@@ -407,10 +407,10 @@ mod tests {
 
         unsafe {
             O.call_once(|| {
-                assert!(!run);
-                run = true;
+                assert!(!RUN);
+                RUN = true;
             });
-            assert!(run);
+            assert!(RUN);
         }
 
         for _ in 0..10 {