Skip to content

Commit 1e3b57e

Browse files
authored
Rollup merge of #64500 - nnethercote:ObligForest-fixups, r=nikomatsakis
Various `ObligationForest` improvements These commits make the code both nicer and faster. r? @nikomatsakis
2 parents 69e93e8 + 4ecd94e commit 1e3b57e

File tree

4 files changed

+148
-167
lines changed

4 files changed

+148
-167
lines changed

src/librustc_data_structures/indexed_vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ macro_rules! newtype_index {
149149

150150
#[inline]
151151
$v const unsafe fn from_u32_unchecked(value: u32) -> Self {
152-
unsafe { $type { private: value } }
152+
$type { private: value }
153153
}
154154

155155
/// Extracts the value of this index as an integer.

src/librustc_data_structures/obligation_forest/graphviz.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ impl<'a, O: ForestObligation + 'a> dot::GraphWalk<'a> for &'a ObligationForest<O
7474
.flat_map(|i| {
7575
let node = &self.nodes[i];
7676

77-
node.parent.iter().map(|p| p.get())
78-
.chain(node.dependents.iter().map(|p| p.get()))
79-
.map(move |p| (p, i))
77+
node.parent.iter()
78+
.chain(node.dependents.iter())
79+
.map(move |p| (p.index(), i))
8080
})
8181
.collect()
8282
}

0 commit comments

Comments
 (0)