Skip to content

Commit 1e6e082

Browse files
Remove uses of Vec::remove_item
1 parent ef10694 commit 1e6e082

File tree

7 files changed

+3
-21
lines changed

7 files changed

+3
-21
lines changed

src/liballoc/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#![feature(associated_type_bounds)]
1313
#![feature(binary_heap_into_iter_sorted)]
1414
#![feature(binary_heap_drain_sorted)]
15-
#![feature(vec_remove_item)]
1615
#![feature(split_inclusive)]
1716
#![feature(binary_heap_retain)]
1817

src/liballoc/tests/vec.rs

-15
Original file line numberDiff line numberDiff line change
@@ -131,21 +131,6 @@ fn test_extend_ref() {
131131
assert_eq!(v, [1, 2, 3, 4, 5, 6, 7]);
132132
}
133133

134-
#[test]
135-
fn test_remove_item() {
136-
let mut v = vec![1, 2, 3];
137-
v.remove_item(&1);
138-
139-
assert_eq!(v.len(), 2);
140-
assert_eq!(v, [2, 3]);
141-
142-
let mut w = vec![1, 2, 3];
143-
w.remove_item(&4);
144-
145-
assert_eq!(w.len(), 3);
146-
w.remove_item(&4);
147-
}
148-
149134
#[test]
150135
fn test_slice_from_mut() {
151136
let mut values = vec![1, 2, 3, 4, 5];

src/librustc_middle/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#![feature(min_specialization)]
4646
#![feature(track_caller)]
4747
#![feature(trusted_len)]
48-
#![feature(vec_remove_item)]
4948
#![feature(stmt_expr_attributes)]
5049
#![feature(test)]
5150
#![feature(in_band_lifetimes)]

src/librustc_query_system/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#![feature(hash_raw_entry)]
77
#![feature(min_specialization)]
88
#![feature(stmt_expr_attributes)]
9-
#![feature(vec_remove_item)]
109

1110
#[macro_use]
1211
extern crate log;

src/librustc_query_system/query/job.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,9 @@ fn remove_cycle<CTX: QueryContext>(
452452

453453
// Remove the queries in our cycle from the list of jobs to look at
454454
for r in &stack {
455-
jobs.remove_item(&r.1);
455+
if let Some(pos) = jobs.iter().position(|j| j == &r.1) {
456+
jobs.remove(pos);
457+
}
456458
}
457459

458460
// Find the queries in the cycle which are

src/librustdoc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#![feature(nll)]
1010
#![feature(or_patterns)]
1111
#![feature(test)]
12-
#![feature(vec_remove_item)]
1312
#![feature(ptr_offset_from)]
1413
#![feature(crate_visibility_modifier)]
1514
#![feature(never_type)]

src/tools/compiletest/src/main.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![crate_name = "compiletest"]
2-
#![feature(vec_remove_item)]
32
#![deny(warnings)]
43
// The `test` crate is the only unstable feature
54
// allowed here, just to share similar code.

0 commit comments

Comments
 (0)