Skip to content

Commit 58632f3

Browse files
committed
tests: fix fallout from empowering unused_allocation in comparisons.
1 parent 3ce4438 commit 58632f3

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/libcollections/tests/binary_heap.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -134,22 +134,22 @@ fn test_push() {
134134
fn test_push_unique() {
135135
let mut heap = BinaryHeap::<Box<_>>::from(vec![box 2, box 4, box 9]);
136136
assert_eq!(heap.len(), 3);
137-
assert!(*heap.peek().unwrap() == box 9);
137+
assert!(**heap.peek().unwrap() == 9);
138138
heap.push(box 11);
139139
assert_eq!(heap.len(), 4);
140-
assert!(*heap.peek().unwrap() == box 11);
140+
assert!(**heap.peek().unwrap() == 11);
141141
heap.push(box 5);
142142
assert_eq!(heap.len(), 5);
143-
assert!(*heap.peek().unwrap() == box 11);
143+
assert!(**heap.peek().unwrap() == 11);
144144
heap.push(box 27);
145145
assert_eq!(heap.len(), 6);
146-
assert!(*heap.peek().unwrap() == box 27);
146+
assert!(**heap.peek().unwrap() == 27);
147147
heap.push(box 3);
148148
assert_eq!(heap.len(), 7);
149-
assert!(*heap.peek().unwrap() == box 27);
149+
assert!(**heap.peek().unwrap() == 27);
150150
heap.push(box 103);
151151
assert_eq!(heap.len(), 8);
152-
assert!(*heap.peek().unwrap() == box 103);
152+
assert!(**heap.peek().unwrap() == 103);
153153
}
154154

155155
fn check_to_vec(mut data: Vec<i32>) {

src/libstd/sync/mpsc/mod.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -1924,7 +1924,7 @@ mod tests {
19241924
fn oneshot_single_thread_send_then_recv() {
19251925
let (tx, rx) = channel::<Box<i32>>();
19261926
tx.send(box 10).unwrap();
1927-
assert!(rx.recv().unwrap() == box 10);
1927+
assert!(*rx.recv().unwrap() == 10);
19281928
}
19291929

19301930
#[test]
@@ -1981,7 +1981,7 @@ mod tests {
19811981
fn oneshot_multi_task_recv_then_send() {
19821982
let (tx, rx) = channel::<Box<i32>>();
19831983
let _t = thread::spawn(move|| {
1984-
assert!(rx.recv().unwrap() == box 10);
1984+
assert!(*rx.recv().unwrap() == 10);
19851985
});
19861986

19871987
tx.send(box 10).unwrap();
@@ -1994,7 +1994,7 @@ mod tests {
19941994
drop(tx);
19951995
});
19961996
let res = thread::spawn(move|| {
1997-
assert!(rx.recv().unwrap() == box 10);
1997+
assert!(*rx.recv().unwrap() == 10);
19981998
}).join();
19991999
assert!(res.is_err());
20002000
}
@@ -2048,7 +2048,7 @@ mod tests {
20482048
let _t = thread::spawn(move|| {
20492049
tx.send(box 10).unwrap();
20502050
});
2051-
assert!(rx.recv().unwrap() == box 10);
2051+
assert!(*rx.recv().unwrap() == 10);
20522052
}
20532053
}
20542054

@@ -2073,7 +2073,7 @@ mod tests {
20732073
if i == 10 { return }
20742074

20752075
thread::spawn(move|| {
2076-
assert!(rx.recv().unwrap() == box i);
2076+
assert!(*rx.recv().unwrap() == i);
20772077
recv(rx, i + 1);
20782078
});
20792079
}
@@ -2610,7 +2610,7 @@ mod sync_tests {
26102610
fn oneshot_single_thread_send_then_recv() {
26112611
let (tx, rx) = sync_channel::<Box<i32>>(1);
26122612
tx.send(box 10).unwrap();
2613-
assert!(rx.recv().unwrap() == box 10);
2613+
assert!(*rx.recv().unwrap() == 10);
26142614
}
26152615

26162616
#[test]
@@ -2682,7 +2682,7 @@ mod sync_tests {
26822682
fn oneshot_multi_task_recv_then_send() {
26832683
let (tx, rx) = sync_channel::<Box<i32>>(0);
26842684
let _t = thread::spawn(move|| {
2685-
assert!(rx.recv().unwrap() == box 10);
2685+
assert!(*rx.recv().unwrap() == 10);
26862686
});
26872687

26882688
tx.send(box 10).unwrap();
@@ -2695,7 +2695,7 @@ mod sync_tests {
26952695
drop(tx);
26962696
});
26972697
let res = thread::spawn(move|| {
2698-
assert!(rx.recv().unwrap() == box 10);
2698+
assert!(*rx.recv().unwrap() == 10);
26992699
}).join();
27002700
assert!(res.is_err());
27012701
}
@@ -2749,7 +2749,7 @@ mod sync_tests {
27492749
let _t = thread::spawn(move|| {
27502750
tx.send(box 10).unwrap();
27512751
});
2752-
assert!(rx.recv().unwrap() == box 10);
2752+
assert!(*rx.recv().unwrap() == 10);
27532753
}
27542754
}
27552755

@@ -2774,7 +2774,7 @@ mod sync_tests {
27742774
if i == 10 { return }
27752775

27762776
thread::spawn(move|| {
2777-
assert!(rx.recv().unwrap() == box i);
2777+
assert!(*rx.recv().unwrap() == i);
27782778
recv(rx, i + 1);
27792779
});
27802780
}

0 commit comments

Comments
 (0)