Skip to content

Commit 3b26b3d

Browse files
committed
don't use SnapshotVec in Graph implementation, as it looks unused; use Vec instead
1 parent 9847c64 commit 3b26b3d

File tree

1 file changed

+4
-19
lines changed
  • compiler/rustc_data_structures/src/graph/implementation

1 file changed

+4
-19
lines changed

compiler/rustc_data_structures/src/graph/implementation/mod.rs

+4-19
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,15 @@
2020
//! the field `next_edge`). Each of those fields is an array that should
2121
//! be indexed by the direction (see the type `Direction`).
2222
23-
use crate::snapshot_vec::{SnapshotVec, SnapshotVecDelegate};
2423
use rustc_index::bit_set::BitSet;
2524
use std::fmt::Debug;
2625

2726
#[cfg(test)]
2827
mod tests;
2928

3029
pub struct Graph<N, E> {
31-
nodes: SnapshotVec<Node<N>>,
32-
edges: SnapshotVec<Edge<E>>,
30+
nodes: Vec<Node<N>>,
31+
edges: Vec<Edge<E>>,
3332
}
3433

3534
pub struct Node<N> {
@@ -45,20 +44,6 @@ pub struct Edge<E> {
4544
pub data: E,
4645
}
4746

48-
impl<N> SnapshotVecDelegate for Node<N> {
49-
type Value = Node<N>;
50-
type Undo = ();
51-
52-
fn reverse(_: &mut Vec<Node<N>>, _: ()) {}
53-
}
54-
55-
impl<N> SnapshotVecDelegate for Edge<N> {
56-
type Value = Edge<N>;
57-
type Undo = ();
58-
59-
fn reverse(_: &mut Vec<Edge<N>>, _: ()) {}
60-
}
61-
6247
#[derive(Copy, Clone, PartialEq, Debug)]
6348
pub struct NodeIndex(pub usize);
6449

@@ -86,11 +71,11 @@ impl NodeIndex {
8671

8772
impl<N: Debug, E: Debug> Graph<N, E> {
8873
pub fn new() -> Graph<N, E> {
89-
Graph { nodes: SnapshotVec::new(), edges: SnapshotVec::new() }
74+
Graph { nodes: Vec::new(), edges: Vec::new() }
9075
}
9176

9277
pub fn with_capacity(nodes: usize, edges: usize) -> Graph<N, E> {
93-
Graph { nodes: SnapshotVec::with_capacity(nodes), edges: SnapshotVec::with_capacity(edges) }
78+
Graph { nodes: Vec::with_capacity(nodes), edges: Vec::with_capacity(edges) }
9479
}
9580

9681
// # Simple accessors

0 commit comments

Comments
 (0)