1
Fork 0

Remove unused code from rustc_middle

This commit is contained in:
est31 2020-10-09 11:20:28 +02:00
parent f243a2ad90
commit d7791f485b
12 changed files with 7 additions and 214 deletions

View file

@ -7,7 +7,6 @@ pub use self::Variance::*;
use crate::hir::exports::ExportMap;
use crate::ich::StableHashingContext;
use crate::infer::canonical::Canonical;
use crate::middle::cstore::CrateStoreDyn;
use crate::middle::resolve_lifetime::ObjectLifetimeDefault;
use crate::mir::interpret::ErrorHandled;
@ -656,8 +655,6 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TyS<'tcx> {
#[rustc_diagnostic_item = "Ty"]
pub type Ty<'tcx> = &'tcx TyS<'tcx>;
pub type CanonicalTy<'tcx> = Canonical<'tcx, Ty<'tcx>>;
#[derive(Clone, Copy, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
pub struct UpvarPath {
pub hir_id: hir::HirId,
@ -767,10 +764,6 @@ pub enum IntVarValue {
pub struct FloatVarValue(pub ast::FloatTy);
impl ty::EarlyBoundRegion {
pub fn to_bound_region(&self) -> ty::BoundRegion {
ty::BoundRegion::BrNamed(self.def_id, self.name)
}
/// Does this early bound region have a name? Early bound regions normally
/// always have names except when using anonymous lifetimes (`'_`).
pub fn has_name(&self) -> bool {
@ -821,14 +814,6 @@ impl GenericParamDef {
bug!("cannot convert a non-lifetime parameter def to an early bound region")
}
}
pub fn to_bound_region(&self) -> ty::BoundRegion {
if let GenericParamDefKind::Lifetime = self.kind {
self.to_early_bound_region_data().to_bound_region()
} else {
bug!("cannot convert a non-lifetime parameter def to an early bound region")
}
}
}
#[derive(Default)]
@ -1003,22 +988,6 @@ impl<'tcx> GenericPredicates<'tcx> {
instantiated.predicates.extend(self.predicates.iter().map(|(p, _)| p));
instantiated.spans.extend(self.predicates.iter().map(|(_, s)| s));
}
pub fn instantiate_supertrait(
&self,
tcx: TyCtxt<'tcx>,
poly_trait_ref: &ty::PolyTraitRef<'tcx>,
) -> InstantiatedPredicates<'tcx> {
assert_eq!(self.parent, None);
InstantiatedPredicates {
predicates: self
.predicates
.iter()
.map(|(pred, _)| pred.subst_supertrait(tcx, poly_trait_ref))
.collect(),
spans: self.predicates.iter().map(|(_, sp)| *sp).collect(),
}
}
}
#[derive(Debug)]
@ -1303,7 +1272,6 @@ impl<'tcx> PolyTraitPredicate<'tcx> {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, TyEncodable, TyDecodable)]
#[derive(HashStable, TypeFoldable)]
pub struct OutlivesPredicate<A, B>(pub A, pub B); // `A: B`
pub type PolyOutlivesPredicate<A, B> = ty::Binder<OutlivesPredicate<A, B>>;
pub type RegionOutlivesPredicate<'tcx> = OutlivesPredicate<ty::Region<'tcx>, ty::Region<'tcx>>;
pub type TypeOutlivesPredicate<'tcx> = OutlivesPredicate<Ty<'tcx>, ty::Region<'tcx>>;
pub type PolyRegionOutlivesPredicate<'tcx> = ty::Binder<RegionOutlivesPredicate<'tcx>>;