Skip to content

Commit 72399f2

Browse files
committed
Rename static mut to upper case
1 parent 350b0d8 commit 72399f2

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

src/libcollectionstest/vec.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -271,22 +271,22 @@ fn test_zip_unzip() {
271271

272272
#[test]
273273
fn test_vec_truncate_drop() {
274-
static mut drops: u32 = 0;
274+
static mut DROPS: u32 = 0;
275275
struct Elem(i32);
276276
impl Drop for Elem {
277277
fn drop(&mut self) {
278278
unsafe {
279-
drops += 1;
279+
DROPS += 1;
280280
}
281281
}
282282
}
283283

284284
let mut v = vec![Elem(1), Elem(2), Elem(3), Elem(4), Elem(5)];
285-
assert_eq!(unsafe { drops }, 0);
285+
assert_eq!(unsafe { DROPS }, 0);
286286
v.truncate(3);
287-
assert_eq!(unsafe { drops }, 2);
287+
assert_eq!(unsafe { DROPS }, 2);
288288
v.truncate(0);
289-
assert_eq!(unsafe { drops }, 5);
289+
assert_eq!(unsafe { DROPS }, 5);
290290
}
291291

292292
#[test]

src/libcollectionstest/vec_deque.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -695,12 +695,12 @@ fn test_show() {
695695

696696
#[test]
697697
fn test_drop() {
698-
static mut drops: i32 = 0;
698+
static mut DROPS: i32 = 0;
699699
struct Elem;
700700
impl Drop for Elem {
701701
fn drop(&mut self) {
702702
unsafe {
703-
drops += 1;
703+
DROPS += 1;
704704
}
705705
}
706706
}
@@ -712,17 +712,17 @@ fn test_drop() {
712712
ring.push_front(Elem);
713713
drop(ring);
714714

715-
assert_eq!(unsafe { drops }, 4);
715+
assert_eq!(unsafe { DROPS }, 4);
716716
}
717717

718718
#[test]
719719
fn test_drop_with_pop() {
720-
static mut drops: i32 = 0;
720+
static mut DROPS: i32 = 0;
721721
struct Elem;
722722
impl Drop for Elem {
723723
fn drop(&mut self) {
724724
unsafe {
725-
drops += 1;
725+
DROPS += 1;
726726
}
727727
}
728728
}
@@ -735,20 +735,20 @@ fn test_drop_with_pop() {
735735

736736
drop(ring.pop_back());
737737
drop(ring.pop_front());
738-
assert_eq!(unsafe { drops }, 2);
738+
assert_eq!(unsafe { DROPS }, 2);
739739

740740
drop(ring);
741-
assert_eq!(unsafe { drops }, 4);
741+
assert_eq!(unsafe { DROPS }, 4);
742742
}
743743

744744
#[test]
745745
fn test_drop_clear() {
746-
static mut drops: i32 = 0;
746+
static mut DROPS: i32 = 0;
747747
struct Elem;
748748
impl Drop for Elem {
749749
fn drop(&mut self) {
750750
unsafe {
751-
drops += 1;
751+
DROPS += 1;
752752
}
753753
}
754754
}
@@ -759,10 +759,10 @@ fn test_drop_clear() {
759759
ring.push_back(Elem);
760760
ring.push_front(Elem);
761761
ring.clear();
762-
assert_eq!(unsafe { drops }, 4);
762+
assert_eq!(unsafe { DROPS }, 4);
763763

764764
drop(ring);
765-
assert_eq!(unsafe { drops }, 4);
765+
assert_eq!(unsafe { DROPS }, 4);
766766
}
767767

768768
#[test]

src/libstd/sync/once.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ mod tests {
387387
#[test]
388388
fn stampede_once() {
389389
static O: Once = Once::new();
390-
static mut run: bool = false;
390+
static mut RUN: bool = false;
391391

392392
let (tx, rx) = channel();
393393
for _ in 0..10 {
@@ -396,21 +396,21 @@ mod tests {
396396
for _ in 0..4 { thread::yield_now() }
397397
unsafe {
398398
O.call_once(|| {
399-
assert!(!run);
400-
run = true;
399+
assert!(!RUN);
400+
RUN = true;
401401
});
402-
assert!(run);
402+
assert!(RUN);
403403
}
404404
tx.send(()).unwrap();
405405
});
406406
}
407407

408408
unsafe {
409409
O.call_once(|| {
410-
assert!(!run);
411-
run = true;
410+
assert!(!RUN);
411+
RUN = true;
412412
});
413-
assert!(run);
413+
assert!(RUN);
414414
}
415415

416416
for _ in 0..10 {

src/rtstartup/rsbegin.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub mod eh_frames {
4444

4545
// Scratch space for unwinder's internal book-keeping.
4646
// This is defined as `struct object` in $GCC/libgcc/unwind-dw2-fde.h.
47-
static mut obj: [isize; 6] = [0; 6];
47+
static mut OBJ: [isize; 6] = [0; 6];
4848

4949
// Unwind info registration/deregistration routines.
5050
// See the docs of `unwind` module in libstd.
@@ -56,13 +56,13 @@ pub mod eh_frames {
5656
unsafe fn init() {
5757
// register unwind info on module startup
5858
rust_eh_register_frames(&__EH_FRAME_BEGIN__ as *const u8,
59-
&mut obj as *mut _ as *mut u8);
59+
&mut OBJ as *mut _ as *mut u8);
6060
}
6161

6262
unsafe fn uninit() {
6363
// unregister on shutdown
6464
rust_eh_unregister_frames(&__EH_FRAME_BEGIN__ as *const u8,
65-
&mut obj as *mut _ as *mut u8);
65+
&mut OBJ as *mut _ as *mut u8);
6666
}
6767

6868
// MSVC-specific init/uninit routine registration

0 commit comments

Comments
 (0)