diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2017-09-27 16:31:31 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2017-09-27 16:32:27 -0300 |
| commit | 70c3a3da6d6aa9b818c76dc0c3afd31fb2249cfb (patch) | |
| tree | e699def9ee08208d61593a71922685e9f35f2937 | |
| parent | 0e6f4cf51cd3b799fb057956f8e733d16605d09b (diff) | |
| download | rust-70c3a3da6d6aa9b818c76dc0c3afd31fb2249cfb.tar.gz rust-70c3a3da6d6aa9b818c76dc0c3afd31fb2249cfb.zip | |
Remove DepNodeIndexNew::new and ::index, they are already impl for Idx
| -rw-r--r-- | src/librustc/dep_graph/graph.rs | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/librustc/dep_graph/graph.rs b/src/librustc/dep_graph/graph.rs index 71a7ee84cd1..d9770db9d69 100644 --- a/src/librustc/dep_graph/graph.rs +++ b/src/librustc/dep_graph/graph.rs @@ -569,28 +569,20 @@ pub(super) struct DepNodeIndexNew { } impl Idx for DepNodeIndexNew { - fn new(idx: usize) -> Self { - DepNodeIndexNew::new(idx) + fn new(v: usize) -> DepNodeIndexNew { + assert!((v & 0xFFFF_FFFF) == v); + DepNodeIndexNew { index: v as u32 } } + fn index(self) -> usize { - self.index() + self.index as usize } } impl DepNodeIndexNew { - const INVALID: DepNodeIndexNew = DepNodeIndexNew { index: ::std::u32::MAX, }; - - fn new(v: usize) -> DepNodeIndexNew { - assert!((v & 0xFFFF_FFFF) == v); - DepNodeIndexNew { index: v as u32 } - } - - fn index(self) -> usize { - self.index as usize - } } #[derive(Clone, Debug, PartialEq)] |
