Skip to content

Commit 70c3a3d

Browse files
committed
Remove DepNodeIndexNew::new and ::index, they are already impl for Idx
1 parent 0e6f4cf commit 70c3a3d

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/librustc/dep_graph/graph.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -569,28 +569,20 @@ pub(super) struct DepNodeIndexNew {
569569
}
570570

571571
impl Idx for DepNodeIndexNew {
572-
fn new(idx: usize) -> Self {
573-
DepNodeIndexNew::new(idx)
572+
fn new(v: usize) -> DepNodeIndexNew {
573+
assert!((v & 0xFFFF_FFFF) == v);
574+
DepNodeIndexNew { index: v as u32 }
574575
}
576+
575577
fn index(self) -> usize {
576-
self.index()
578+
self.index as usize
577579
}
578580
}
579581

580582
impl DepNodeIndexNew {
581-
582583
const INVALID: DepNodeIndexNew = DepNodeIndexNew {
583584
index: ::std::u32::MAX,
584585
};
585-
586-
fn new(v: usize) -> DepNodeIndexNew {
587-
assert!((v & 0xFFFF_FFFF) == v);
588-
DepNodeIndexNew { index: v as u32 }
589-
}
590-
591-
fn index(self) -> usize {
592-
self.index as usize
593-
}
594586
}
595587

596588
#[derive(Clone, Debug, PartialEq)]

0 commit comments

Comments
 (0)