about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/graph/vec_graph
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-12-22 22:33:11 +0000
committerbors <bors@rust-lang.org>2021-12-22 22:33:11 +0000
commite98309298d927307c5184f4869604bd068d26183 (patch)
tree6aca509102b36b8fa83b4f36e299e15b2ff9e937 /compiler/rustc_data_structures/src/graph/vec_graph
parent34926f0a1681458588a2d4240c0715ef9eff7d35 (diff)
parente6ff0bac1ec1271439ed6a7dd35f861e293cd025 (diff)
downloadrust-e98309298d927307c5184f4869604bd068d26183.tar.gz
rust-e98309298d927307c5184f4869604bd068d26183.zip
Auto merge of #90408 - pierwill:untrack-localdefid-90317, r=cjgillot
Remove `PartialOrd`, `Ord` from `LocalDefId`

Part of work on https://github.com/rust-lang/rust/issues/90317.
Diffstat (limited to 'compiler/rustc_data_structures/src/graph/vec_graph')
-rw-r--r--compiler/rustc_data_structures/src/graph/vec_graph/mod.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_data_structures/src/graph/vec_graph/mod.rs b/compiler/rustc_data_structures/src/graph/vec_graph/mod.rs
index 5d9bc1b2e51..3d91bcade59 100644
--- a/compiler/rustc_data_structures/src/graph/vec_graph/mod.rs
+++ b/compiler/rustc_data_structures/src/graph/vec_graph/mod.rs
@@ -1,3 +1,5 @@
+use std::cmp::Ord;
+
 use crate::graph::{DirectedGraph, GraphSuccessors, WithNumEdges, WithNumNodes, WithSuccessors};
 use rustc_index::vec::{Idx, IndexVec};
 
@@ -17,7 +19,7 @@ pub struct VecGraph<N: Idx> {
     edge_targets: Vec<N>,
 }
 
-impl<N: Idx> VecGraph<N> {
+impl<N: Idx + Ord> VecGraph<N> {
     pub fn new(num_nodes: usize, mut edge_pairs: Vec<(N, N)>) -> Self {
         // Sort the edges by the source -- this is important.
         edge_pairs.sort();
@@ -100,7 +102,7 @@ impl<'graph, N: Idx> GraphSuccessors<'graph> for VecGraph<N> {
     type Iter = std::iter::Cloned<std::slice::Iter<'graph, N>>;
 }
 
-impl<N: Idx> WithSuccessors for VecGraph<N> {
+impl<N: Idx + Ord> WithSuccessors for VecGraph<N> {
     fn successors(&self, node: N) -> <Self as GraphSuccessors<'_>>::Iter {
         self.successors(node).iter().cloned()
     }