Skip to content

Commit 6e30bda

Browse files
committed
use sync source_span in Untracked
1 parent 720f717 commit 6e30bda

File tree

1 file changed

+1
-18
lines changed
  • compiler/rustc_data_structures/src/sync

1 file changed

+1
-18
lines changed

compiler/rustc_data_structures/src/sync/vec.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,22 @@ use rustc_index::vec::Idx;
44

55
#[derive(Default)]
66
pub struct AppendOnlyIndexVec<I: Idx, T: Copy> {
7-
#[cfg(not(parallel_compiler))]
8-
vec: elsa::vec::FrozenVec<T>,
9-
#[cfg(parallel_compiler)]
107
vec: elsa::sync::LockFreeFrozenVec<T>,
118
_marker: PhantomData<fn(&I)>,
129
}
1310

1411
impl<I: Idx, T: Copy> AppendOnlyIndexVec<I, T> {
1512
pub fn new() -> Self {
16-
Self {
17-
#[cfg(not(parallel_compiler))]
18-
vec: elsa::vec::FrozenVec::new(),
19-
#[cfg(parallel_compiler)]
20-
vec: elsa::sync::LockFreeFrozenVec::new(),
21-
_marker: PhantomData,
22-
}
13+
Self { vec: elsa::sync::LockFreeFrozenVec::new(), _marker: PhantomData }
2314
}
2415

2516
pub fn push(&self, val: T) -> I {
26-
#[cfg(not(parallel_compiler))]
27-
let i = self.vec.len();
28-
#[cfg(not(parallel_compiler))]
29-
self.vec.push(val);
30-
#[cfg(parallel_compiler)]
3117
let i = self.vec.push(val);
3218
I::new(i)
3319
}
3420

3521
pub fn get(&self, i: I) -> Option<T> {
3622
let i = i.index();
37-
#[cfg(not(parallel_compiler))]
38-
return self.vec.get_copy(i);
39-
#[cfg(parallel_compiler)]
4023
return self.vec.get(i);
4124
}
4225
}

0 commit comments

Comments
 (0)