1
Fork 0

Remove (lots of) dead code

Found with https://github.com/est31/warnalyzer.

Dubious changes:
- Is anyone else using rustc_apfloat? I feel weird completely deleting
  x87 support.
- Maybe some of the dead code in rustc_data_structures, in case someone
  wants to use it in the future?
- Don't change rustc_serialize

  I plan to scrap most of the json module in the near future (see
  https://github.com/rust-lang/compiler-team/issues/418) and fixing the
  tests needed more work than I expected.

TODO: check if any of the comments on the deleted code should be kept.
This commit is contained in:
Joshua Nelson 2021-03-16 01:50:34 -04:00
parent 785aeac521
commit 441dc3640a
74 changed files with 60 additions and 1298 deletions

View file

@ -52,6 +52,7 @@ impl EdgeFilter {
}
}
#[cfg(debug_assertions)]
pub fn test<K: DepKind>(&self, source: &DepNode<K>, target: &DepNode<K>) -> bool {
self.source.test(source) && self.target.test(target)
}

View file

@ -488,8 +488,8 @@ impl<K: DepKind> DepGraph<K> {
self.data.is_some() && self.dep_node_index_of_opt(dep_node).is_some()
}
#[inline]
pub fn dep_node_of(&self, dep_node_index: DepNodeIndex) -> DepNode<K> {
#[cfg(debug_assertions)]
fn dep_node_of(&self, dep_node_index: DepNodeIndex) -> DepNode<K> {
let data = self.data.as_ref().unwrap();
let previous = &data.previous;
let data = data.current.data.lock();

View file

@ -35,11 +35,6 @@ impl<K: DepKind> PreviousDepGraph<K> {
self.data.nodes[dep_node_index]
}
#[inline]
pub fn node_to_index(&self, dep_node: &DepNode<K>) -> SerializedDepNodeIndex {
self.index[dep_node]
}
#[inline]
pub fn node_to_index_opt(&self, dep_node: &DepNode<K>) -> Option<SerializedDepNodeIndex> {
self.index.get(dep_node).cloned()

View file

@ -31,10 +31,6 @@ impl<K: DepKind> DepGraphQuery<K> {
DepGraphQuery { graph, indices }
}
pub fn contains_node(&self, node: &DepNode<K>) -> bool {
self.indices.contains_key(&node)
}
pub fn nodes(&self) -> Vec<&DepNode<K>> {
self.graph.all_nodes().iter().map(|n| &n.data).collect()
}