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

@ -6,7 +6,6 @@ use crate::ty;
use rustc_data_structures::fx::{FxHashMap, FxIndexMap};
use rustc_hir as hir;
use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_hir::lang_items::LangItem;
use rustc_span::Span;
use super::{Ty, TyCtxt};
@ -113,14 +112,6 @@ impl<'tcx> ClosureKind {
// This is the initial value used when doing upvar inference.
pub const LATTICE_BOTTOM: ClosureKind = ClosureKind::Fn;
pub fn trait_did(&self, tcx: TyCtxt<'tcx>) -> DefId {
match *self {
ClosureKind::Fn => tcx.require_lang_item(LangItem::Fn, None),
ClosureKind::FnMut => tcx.require_lang_item(LangItem::FnMut, None),
ClosureKind::FnOnce => tcx.require_lang_item(LangItem::FnOnce, None),
}
}
/// Returns `true` if a type that impls this closure kind
/// must also implement `other`.
pub fn extends(self, other: ty::ClosureKind) -> bool {
@ -377,12 +368,4 @@ impl BorrowKind {
UniqueImmBorrow => hir::Mutability::Mut,
}
}
pub fn to_user_str(&self) -> &'static str {
match *self {
MutBorrow => "mutable",
ImmBorrow => "immutable",
UniqueImmBorrow => "uniquely immutable",
}
}
}