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:
@@ -618,22 +618,12 @@ pub struct ProjectionPredicate<'tcx> {
|
||||
pub type PolyProjectionPredicate<'tcx> = Binder<ProjectionPredicate<'tcx>>;
|
||||
|
||||
impl<'tcx> PolyProjectionPredicate<'tcx> {
|
||||
/// Returns the `DefId` of the associated item being projected.
|
||||
pub fn item_def_id(&self) -> DefId {
|
||||
self.skip_binder().projection_ty.item_def_id
|
||||
}
|
||||
|
||||
/// Returns the `DefId` of the trait of the associated item being projected.
|
||||
#[inline]
|
||||
pub fn trait_def_id(&self, tcx: TyCtxt<'tcx>) -> DefId {
|
||||
self.skip_binder().projection_ty.trait_def_id(tcx)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn projection_self_ty(&self) -> Binder<Ty<'tcx>> {
|
||||
self.map_bound(|predicate| predicate.projection_ty.self_ty())
|
||||
}
|
||||
|
||||
/// Get the [PolyTraitRef] required for this projection to be well formed.
|
||||
/// Note that for generic associated types the predicates of the associated
|
||||
/// type also need to be checked.
|
||||
@@ -1039,10 +1029,6 @@ impl WithOptConstParam<DefId> {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn expect_local(self) -> WithOptConstParam<LocalDefId> {
|
||||
self.as_local().unwrap()
|
||||
}
|
||||
|
||||
pub fn is_local(self) -> bool {
|
||||
self.did.is_local()
|
||||
}
|
||||
@@ -1222,11 +1208,6 @@ pub trait WithConstness: Sized {
|
||||
ConstnessAnd { constness, value: self }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn with_const(self) -> ConstnessAnd<Self> {
|
||||
self.with_constness(Constness::Const)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn without_const(self) -> ConstnessAnd<Self> {
|
||||
self.with_constness(Constness::NotConst)
|
||||
|
||||
Reference in New Issue
Block a user