diff --git a/src/librustc_data_structures/obligation_forest/mod.rs b/src/librustc_data_structures/obligation_forest/mod.rs index 42a17d33fa6f5c795562c783cd5bacd882e3f666..612f44f09cf65cf0ac614396061f238eed68783e 100644 --- a/src/librustc_data_structures/obligation_forest/mod.rs +++ b/src/librustc_data_structures/obligation_forest/mod.rs @@ -75,9 +75,6 @@ pub struct ObligationForest { done_cache: FxHashSet, /// An cache of the nodes in `nodes`, indexed by predicate. waiting_cache: FxHashMap, - /// A list of the obligations added in snapshots, to allow - /// for their removal. - cache_list: Vec, scratch: Option>, } @@ -158,7 +155,6 @@ pub fn new() -> ObligationForest { nodes: vec![], done_cache: FxHashSet(), waiting_cache: FxHashMap(), - cache_list: vec![], scratch: Some(vec![]), } } @@ -207,7 +203,6 @@ fn register_obligation_at(&mut self, obligation: O, parent: Option) debug!("register_obligation_at({:?}, {:?}) - ok, new index is {}", obligation, parent, self.nodes.len()); v.insert(NodeIndex::new(self.nodes.len())); - self.cache_list.push(obligation.as_predicate().clone()); self.nodes.push(Node::new(parent, obligation)); Ok(()) } diff --git a/src/librustc_data_structures/obligation_forest/node_index.rs b/src/librustc_data_structures/obligation_forest/node_index.rs index 37512e4bcd57f334e971f44aff537f61475d2eba..d89bd22ec9637d2221b0a7cc3b7b8b05b0456776 100644 --- a/src/librustc_data_structures/obligation_forest/node_index.rs +++ b/src/librustc_data_structures/obligation_forest/node_index.rs @@ -17,11 +17,13 @@ pub struct NodeIndex { } impl NodeIndex { + #[inline] pub fn new(value: usize) -> NodeIndex { assert!(value < (u32::MAX as usize)); NodeIndex { index: NonZeroU32::new((value as u32) + 1).unwrap() } } + #[inline] pub fn get(self) -> usize { (self.index.get() - 1) as usize }