Skip to content

Commit

Permalink
Rollup merge of rust-lang#64500 - nnethercote:ObligForest-fixups, r=n…
Browse files Browse the repository at this point in the history
…ikomatsakis

Various `ObligationForest` improvements

These commits make the code both nicer and faster.

r? @nikomatsakis
  • Loading branch information
Centril authored Sep 17, 2019
2 parents 69e93e8 + 4ecd94e commit 1e3b57e
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 167 deletions.
2 changes: 1 addition & 1 deletion src/librustc_data_structures/indexed_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ macro_rules! newtype_index {

#[inline]
$v const unsafe fn from_u32_unchecked(value: u32) -> Self {
unsafe { $type { private: value } }
$type { private: value }
}

/// Extracts the value of this index as an integer.
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_data_structures/obligation_forest/graphviz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ impl<'a, O: ForestObligation + 'a> dot::GraphWalk<'a> for &'a ObligationForest<O
.flat_map(|i| {
let node = &self.nodes[i];

node.parent.iter().map(|p| p.get())
.chain(node.dependents.iter().map(|p| p.get()))
.map(move |p| (p, i))
node.parent.iter()
.chain(node.dependents.iter())
.map(move |p| (p.index(), i))
})
.collect()
}
Expand Down
Loading

0 comments on commit 1e3b57e

Please sign in to comment.