Skip to content

Commit 9ed2177

Browse files
committed
Remove unused code from rustc_infer
1 parent 6897619 commit 9ed2177

File tree

3 files changed

+0
-40
lines changed

3 files changed

+0
-40
lines changed

compiler/rustc_infer/src/infer/mod.rs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,6 @@ impl Default for RegionckMode {
113113
}
114114

115115
impl RegionckMode {
116-
pub fn suppressed(self) -> bool {
117-
match self {
118-
Self::Solve => false,
119-
Self::Erase { suppress_errors } => suppress_errors,
120-
}
121-
}
122-
123116
/// Indicates that the MIR borrowck will repeat these region
124117
/// checks, so we should ignore errors if NLL is (unconditionally)
125118
/// enabled.
@@ -420,15 +413,6 @@ pub enum SubregionOrigin<'tcx> {
420413
#[cfg(target_arch = "x86_64")]
421414
static_assert_size!(SubregionOrigin<'_>, 32);
422415

423-
/// Places that type/region parameters can appear.
424-
#[derive(Clone, Copy, Debug)]
425-
pub enum ParameterOrigin {
426-
Path, // foo::bar
427-
MethodCall, // foo.bar() <-- parameters on impl providing bar()
428-
OverloadedOperator, // a + b when overloaded
429-
OverloadedDeref, // *a when overloaded
430-
}
431-
432416
/// Times when we replace late-bound regions with variables:
433417
#[derive(Clone, Copy, Debug)]
434418
pub enum LateBoundRegionConversionTime {
@@ -508,21 +492,6 @@ pub enum NLLRegionVariableOrigin {
508492
},
509493
}
510494

511-
impl NLLRegionVariableOrigin {
512-
pub fn is_universal(self) -> bool {
513-
match self {
514-
NLLRegionVariableOrigin::FreeRegion => true,
515-
NLLRegionVariableOrigin::Placeholder(..) => true,
516-
NLLRegionVariableOrigin::Existential { .. } => false,
517-
NLLRegionVariableOrigin::RootEmptyRegion => false,
518-
}
519-
}
520-
521-
pub fn is_existential(self) -> bool {
522-
!self.is_universal()
523-
}
524-
}
525-
526495
// FIXME(eddyb) investigate overlap between this and `TyOrConstInferVar`.
527496
#[derive(Copy, Clone, Debug)]
528497
pub enum FixupError<'tcx> {

compiler/rustc_infer/src/infer/nll_relate/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ use rustc_data_structures::fx::FxHashMap;
2828
use rustc_middle::ty::error::TypeError;
2929
use rustc_middle::ty::fold::{TypeFoldable, TypeVisitor};
3030
use rustc_middle::ty::relate::{self, Relate, RelateResult, TypeRelation};
31-
use rustc_middle::ty::subst::GenericArg;
3231
use rustc_middle::ty::{self, InferConst, Ty, TyCtxt};
3332
use std::fmt::Debug;
3433

@@ -119,12 +118,6 @@ pub trait TypeRelatingDelegate<'tcx> {
119118
fn forbid_inference_vars() -> bool;
120119
}
121120

122-
#[derive(Clone, Debug)]
123-
struct ScopesAndKind<'tcx> {
124-
scopes: Vec<BoundRegionScope<'tcx>>,
125-
kind: GenericArg<'tcx>,
126-
}
127-
128121
#[derive(Clone, Debug, Default)]
129122
struct BoundRegionScope<'tcx> {
130123
map: FxHashMap<ty::BoundRegion, ty::Region<'tcx>>,

compiler/rustc_infer/src/traits/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ pub type TraitObligation<'tcx> = Obligation<'tcx, ty::PolyTraitPredicate<'tcx>>;
5959
#[cfg(target_arch = "x86_64")]
6060
static_assert_size!(PredicateObligation<'_>, 32);
6161

62-
pub type Obligations<'tcx, O> = Vec<Obligation<'tcx, O>>;
6362
pub type PredicateObligations<'tcx> = Vec<PredicateObligation<'tcx>>;
64-
pub type TraitObligations<'tcx> = Vec<TraitObligation<'tcx>>;
6563

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

0 commit comments

Comments
 (0)