Skip to content

Commit

Permalink
Remove unused code from rustc_infer
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 committed Oct 14, 2020
1 parent 6897619 commit 9ed2177
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 40 deletions.
31 changes: 0 additions & 31 deletions compiler/rustc_infer/src/infer/mod.rs
Expand Up @@ -113,13 +113,6 @@ impl Default for RegionckMode {
}

impl RegionckMode {
pub fn suppressed(self) -> bool {
match self {
Self::Solve => false,
Self::Erase { suppress_errors } => suppress_errors,
}
}

/// Indicates that the MIR borrowck will repeat these region
/// checks, so we should ignore errors if NLL is (unconditionally)
/// enabled.
Expand Down Expand Up @@ -420,15 +413,6 @@ pub enum SubregionOrigin<'tcx> {
#[cfg(target_arch = "x86_64")]
static_assert_size!(SubregionOrigin<'_>, 32);

/// Places that type/region parameters can appear.
#[derive(Clone, Copy, Debug)]
pub enum ParameterOrigin {
Path, // foo::bar
MethodCall, // foo.bar() <-- parameters on impl providing bar()
OverloadedOperator, // a + b when overloaded
OverloadedDeref, // *a when overloaded
}

/// Times when we replace late-bound regions with variables:
#[derive(Clone, Copy, Debug)]
pub enum LateBoundRegionConversionTime {
Expand Down Expand Up @@ -508,21 +492,6 @@ pub enum NLLRegionVariableOrigin {
},
}

impl NLLRegionVariableOrigin {
pub fn is_universal(self) -> bool {
match self {
NLLRegionVariableOrigin::FreeRegion => true,
NLLRegionVariableOrigin::Placeholder(..) => true,
NLLRegionVariableOrigin::Existential { .. } => false,
NLLRegionVariableOrigin::RootEmptyRegion => false,
}
}

pub fn is_existential(self) -> bool {
!self.is_universal()
}
}

// FIXME(eddyb) investigate overlap between this and `TyOrConstInferVar`.
#[derive(Copy, Clone, Debug)]
pub enum FixupError<'tcx> {
Expand Down
7 changes: 0 additions & 7 deletions compiler/rustc_infer/src/infer/nll_relate/mod.rs
Expand Up @@ -28,7 +28,6 @@ use rustc_data_structures::fx::FxHashMap;
use rustc_middle::ty::error::TypeError;
use rustc_middle::ty::fold::{TypeFoldable, TypeVisitor};
use rustc_middle::ty::relate::{self, Relate, RelateResult, TypeRelation};
use rustc_middle::ty::subst::GenericArg;
use rustc_middle::ty::{self, InferConst, Ty, TyCtxt};
use std::fmt::Debug;

Expand Down Expand Up @@ -119,12 +118,6 @@ pub trait TypeRelatingDelegate<'tcx> {
fn forbid_inference_vars() -> bool;
}

#[derive(Clone, Debug)]
struct ScopesAndKind<'tcx> {
scopes: Vec<BoundRegionScope<'tcx>>,
kind: GenericArg<'tcx>,
}

#[derive(Clone, Debug, Default)]
struct BoundRegionScope<'tcx> {
map: FxHashMap<ty::BoundRegion, ty::Region<'tcx>>,
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_infer/src/traits/mod.rs
Expand Up @@ -59,9 +59,7 @@ pub type TraitObligation<'tcx> = Obligation<'tcx, ty::PolyTraitPredicate<'tcx>>;
#[cfg(target_arch = "x86_64")]
static_assert_size!(PredicateObligation<'_>, 32);

pub type Obligations<'tcx, O> = Vec<Obligation<'tcx, O>>;
pub type PredicateObligations<'tcx> = Vec<PredicateObligation<'tcx>>;
pub type TraitObligations<'tcx> = Vec<TraitObligation<'tcx>>;

pub type Selection<'tcx> = ImplSource<'tcx, PredicateObligation<'tcx>>;

Expand Down

0 comments on commit 9ed2177

Please sign in to comment.