Skip to content

Commit 6cd24a5

Browse files
committed
kill dead code: Predicate::Equate
1 parent 627a2b4 commit 6cd24a5

File tree

16 files changed

+2
-80
lines changed

16 files changed

+2
-80
lines changed

src/librustc/ich/impls_ty.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,6 @@ impl<'a, 'gcx, 'tcx> HashStable<StableHashingContext<'a, 'gcx, 'tcx>> for ty::Pr
210210
ty::Predicate::Trait(ref pred) => {
211211
pred.hash_stable(hcx, hasher);
212212
}
213-
ty::Predicate::Equate(ref pred) => {
214-
pred.hash_stable(hcx, hasher);
215-
}
216213
ty::Predicate::Subtype(ref pred) => {
217214
pred.hash_stable(hcx, hasher);
218215
}

src/librustc/middle/free_region.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ impl<'tcx> FreeRegionMap<'tcx> {
142142
match *predicate {
143143
ty::Predicate::Projection(..) |
144144
ty::Predicate::Trait(..) |
145-
ty::Predicate::Equate(..) |
146145
ty::Predicate::Subtype(..) |
147146
ty::Predicate::WellFormed(..) |
148147
ty::Predicate::ObjectSafe(..) |

src/librustc/traits/error_reporting.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -616,16 +616,6 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
616616
span_bug!(span, "subtype requirement gave wrong error: `{:?}`", predicate)
617617
}
618618

619-
ty::Predicate::Equate(ref predicate) => {
620-
let predicate = self.resolve_type_vars_if_possible(predicate);
621-
let err = self.equality_predicate(&obligation.cause,
622-
obligation.param_env,
623-
&predicate).err().unwrap();
624-
struct_span_err!(self.tcx.sess, span, E0278,
625-
"the requirement `{}` is not satisfied (`{}`)",
626-
predicate, err)
627-
}
628-
629619
ty::Predicate::RegionOutlives(ref predicate) => {
630620
let predicate = self.resolve_type_vars_if_possible(predicate);
631621
let err = self.region_outlives_predicate(&obligation.cause,

src/librustc/traits/fulfill.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use infer::{InferCtxt, InferOk};
11+
use infer::InferCtxt;
1212
use ty::{self, Ty, TypeFoldable, ToPredicate};
1313
use ty::error::ExpectedFound;
1414
use rustc_data_structures::obligation_forest::{ObligationForest, Error};
@@ -414,17 +414,6 @@ fn process_predicate<'a, 'gcx, 'tcx>(
414414
}
415415
}
416416

417-
ty::Predicate::Equate(ref binder) => {
418-
match selcx.infcx().equality_predicate(&obligation.cause,
419-
obligation.param_env,
420-
binder) {
421-
Ok(InferOk { obligations, value: () }) => {
422-
Ok(Some(obligations))
423-
},
424-
Err(_) => Err(CodeSelectionError(Unimplemented)),
425-
}
426-
}
427-
428417
ty::Predicate::RegionOutlives(ref binder) => {
429418
match selcx.infcx().region_outlives_predicate(&obligation.cause,
430419
obligation.param_env,

src/librustc/traits/object_safety.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
168168
ty::Predicate::TypeOutlives(..) |
169169
ty::Predicate::RegionOutlives(..) |
170170
ty::Predicate::ClosureKind(..) |
171-
ty::Predicate::Subtype(..) |
172-
ty::Predicate::Equate(..) => {
171+
ty::Predicate::Subtype(..) => {
173172
false
174173
}
175174
}
@@ -197,7 +196,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
197196
}
198197
ty::Predicate::Projection(..) |
199198
ty::Predicate::Trait(..) |
200-
ty::Predicate::Equate(..) |
201199
ty::Predicate::Subtype(..) |
202200
ty::Predicate::RegionOutlives(..) |
203201
ty::Predicate::WellFormed(..) |

src/librustc/traits/select.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -621,17 +621,6 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
621621
self.evaluate_trait_predicate_recursively(previous_stack, obligation)
622622
}
623623

624-
ty::Predicate::Equate(ref p) => {
625-
// does this code ever run?
626-
match self.infcx.equality_predicate(&obligation.cause, obligation.param_env, p) {
627-
Ok(InferOk { obligations, .. }) => {
628-
self.evaluate_predicates_recursively(previous_stack, &obligations);
629-
EvaluatedToOk
630-
},
631-
Err(_) => EvaluatedToErr
632-
}
633-
}
634-
635624
ty::Predicate::Subtype(ref p) => {
636625
// does this code ever run?
637626
match self.infcx.subtype_predicate(&obligation.cause, obligation.param_env, p) {

src/librustc/traits/util.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ fn anonymize_predicate<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
2525
ty::Predicate::Trait(ref data) =>
2626
ty::Predicate::Trait(tcx.anonymize_late_bound_regions(data)),
2727

28-
ty::Predicate::Equate(ref data) =>
29-
ty::Predicate::Equate(tcx.anonymize_late_bound_regions(data)),
30-
3128
ty::Predicate::RegionOutlives(ref data) =>
3229
ty::Predicate::RegionOutlives(tcx.anonymize_late_bound_regions(data)),
3330

@@ -160,11 +157,6 @@ impl<'cx, 'gcx, 'tcx> Elaborator<'cx, 'gcx, 'tcx> {
160157
// Currently, we do not elaborate object-safe
161158
// predicates.
162159
}
163-
ty::Predicate::Equate(..) => {
164-
// Currently, we do not "elaborate" predicates like
165-
// `X == Y`, though conceivably we might. For example,
166-
// `&X == &Y` implies that `X == Y`.
167-
}
168160
ty::Predicate::Subtype(..) => {
169161
// Currently, we do not "elaborate" predicates like `X
170162
// <: Y`, though conceivably we might.

src/librustc/ty/mod.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -824,9 +824,6 @@ pub enum Predicate<'tcx> {
824824
/// would be the type parameters.
825825
Trait(PolyTraitRef<'tcx>),
826826

827-
/// where `T1 == T2`.
828-
Equate(PolyEquatePredicate<'tcx>),
829-
830827
/// where 'a : 'b
831828
RegionOutlives(PolyRegionOutlivesPredicate<'tcx>),
832829

@@ -926,8 +923,6 @@ impl<'a, 'gcx, 'tcx> Predicate<'tcx> {
926923
match *self {
927924
Predicate::Trait(ty::Binder(ref data)) =>
928925
Predicate::Trait(ty::Binder(data.subst(tcx, substs))),
929-
Predicate::Equate(ty::Binder(ref data)) =>
930-
Predicate::Equate(ty::Binder(data.subst(tcx, substs))),
931926
Predicate::Subtype(ty::Binder(ref data)) =>
932927
Predicate::Subtype(ty::Binder(data.subst(tcx, substs))),
933928
Predicate::RegionOutlives(ty::Binder(ref data)) =>
@@ -1027,12 +1022,6 @@ impl<'tcx> ToPredicate<'tcx> for PolyTraitRef<'tcx> {
10271022
}
10281023
}
10291024

1030-
impl<'tcx> ToPredicate<'tcx> for PolyEquatePredicate<'tcx> {
1031-
fn to_predicate(&self) -> Predicate<'tcx> {
1032-
Predicate::Equate(self.clone())
1033-
}
1034-
}
1035-
10361025
impl<'tcx> ToPredicate<'tcx> for PolyRegionOutlivesPredicate<'tcx> {
10371026
fn to_predicate(&self) -> Predicate<'tcx> {
10381027
Predicate::RegionOutlives(self.clone())
@@ -1060,9 +1049,6 @@ impl<'tcx> Predicate<'tcx> {
10601049
ty::Predicate::Trait(ref data) => {
10611050
data.skip_binder().input_types().collect()
10621051
}
1063-
ty::Predicate::Equate(ty::Binder(ref data)) => {
1064-
vec![data.0, data.1]
1065-
}
10661052
ty::Predicate::Subtype(ty::Binder(SubtypePredicate { a, b, a_is_expected: _ })) => {
10671053
vec![a, b]
10681054
}
@@ -1100,7 +1086,6 @@ impl<'tcx> Predicate<'tcx> {
11001086
Some(t)
11011087
}
11021088
Predicate::Projection(..) |
1103-
Predicate::Equate(..) |
11041089
Predicate::Subtype(..) |
11051090
Predicate::RegionOutlives(..) |
11061091
Predicate::WellFormed(..) |

src/librustc/ty/structural_impls.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,6 @@ impl<'a, 'tcx> Lift<'tcx> for ty::Predicate<'a> {
188188
ty::Predicate::Trait(ref binder) => {
189189
tcx.lift(binder).map(ty::Predicate::Trait)
190190
}
191-
ty::Predicate::Equate(ref binder) => {
192-
tcx.lift(binder).map(ty::Predicate::Equate)
193-
}
194191
ty::Predicate::Subtype(ref binder) => {
195192
tcx.lift(binder).map(ty::Predicate::Subtype)
196193
}
@@ -871,8 +868,6 @@ impl<'tcx> TypeFoldable<'tcx> for ty::Predicate<'tcx> {
871868
match *self {
872869
ty::Predicate::Trait(ref a) =>
873870
ty::Predicate::Trait(a.fold_with(folder)),
874-
ty::Predicate::Equate(ref binder) =>
875-
ty::Predicate::Equate(binder.fold_with(folder)),
876871
ty::Predicate::Subtype(ref binder) =>
877872
ty::Predicate::Subtype(binder.fold_with(folder)),
878873
ty::Predicate::RegionOutlives(ref binder) =>
@@ -893,7 +888,6 @@ impl<'tcx> TypeFoldable<'tcx> for ty::Predicate<'tcx> {
893888
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {
894889
match *self {
895890
ty::Predicate::Trait(ref a) => a.visit_with(visitor),
896-
ty::Predicate::Equate(ref binder) => binder.visit_with(visitor),
897891
ty::Predicate::Subtype(ref binder) => binder.visit_with(visitor),
898892
ty::Predicate::RegionOutlives(ref binder) => binder.visit_with(visitor),
899893
ty::Predicate::TypeOutlives(ref binder) => binder.visit_with(visitor),

src/librustc/ty/util.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
384384
match predicate {
385385
ty::Predicate::Projection(..) |
386386
ty::Predicate::Trait(..) |
387-
ty::Predicate::Equate(..) |
388387
ty::Predicate::Subtype(..) |
389388
ty::Predicate::WellFormed(..) |
390389
ty::Predicate::ObjectSafe(..) |

src/librustc/ty/wf.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ pub fn predicate_obligations<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
7676
ty::Predicate::Trait(ref t) => {
7777
wf.compute_trait_ref(&t.skip_binder(), Elaborate::None); // (*)
7878
}
79-
ty::Predicate::Equate(ref t) => {
80-
wf.compute(t.skip_binder().0);
81-
wf.compute(t.skip_binder().1);
82-
}
8379
ty::Predicate::RegionOutlives(..) => {
8480
}
8581
ty::Predicate::TypeOutlives(ref t) => {

src/librustc/util/ppaux.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,6 @@ impl<'tcx> fmt::Debug for ty::Predicate<'tcx> {
416416
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
417417
match *self {
418418
ty::Predicate::Trait(ref a) => write!(f, "{:?}", a),
419-
ty::Predicate::Equate(ref pair) => write!(f, "{:?}", pair),
420419
ty::Predicate::Subtype(ref pair) => write!(f, "{:?}", pair),
421420
ty::Predicate::RegionOutlives(ref pair) => write!(f, "{:?}", pair),
422421
ty::Predicate::TypeOutlives(ref pair) => write!(f, "{:?}", pair),
@@ -1035,7 +1034,6 @@ impl<'tcx> fmt::Display for ty::Predicate<'tcx> {
10351034
match *self {
10361035
ty::Predicate::Trait(ref data) =>
10371036
write!(f, "{}", data.map_bound_ref(|t| t.display_all_with_colon())),
1038-
ty::Predicate::Equate(ref predicate) => write!(f, "{}", predicate),
10391037
ty::Predicate::Subtype(ref predicate) => write!(f, "{}", predicate),
10401038
ty::Predicate::RegionOutlives(ref predicate) => write!(f, "{}", predicate),
10411039
ty::Predicate::TypeOutlives(ref predicate) => write!(f, "{}", predicate),

src/librustc_typeck/check/closure.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
187187
let opt_trait_ref = match obligation.predicate {
188188
ty::Predicate::Projection(ref data) => Some(data.to_poly_trait_ref(self.tcx)),
189189
ty::Predicate::Trait(data) => Some(data),
190-
ty::Predicate::Equate(..) => None,
191190
ty::Predicate::Subtype(..) => None,
192191
ty::Predicate::RegionOutlives(..) => None,
193192
ty::Predicate::TypeOutlives(..) => None,

src/librustc_typeck/check/method/probe.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,6 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
583583
_ => None,
584584
}
585585
}
586-
ty::Predicate::Equate(..) |
587586
ty::Predicate::Subtype(..) |
588587
ty::Predicate::Projection(..) |
589588
ty::Predicate::RegionOutlives(..) |

src/librustc_typeck/check/regionck.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,6 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
507507
assert!(!obligation.has_escaping_regions());
508508
match obligation.predicate {
509509
ty::Predicate::Trait(..) |
510-
ty::Predicate::Equate(..) |
511510
ty::Predicate::Subtype(..) |
512511
ty::Predicate::Projection(..) |
513512
ty::Predicate::ClosureKind(..) |

src/librustdoc/clean/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,6 @@ impl<'a> Clean<WherePredicate> for ty::Predicate<'a> {
926926

927927
match *self {
928928
Predicate::Trait(ref pred) => pred.clean(cx),
929-
Predicate::Equate(ref pred) => pred.clean(cx),
930929
Predicate::Subtype(ref pred) => pred.clean(cx),
931930
Predicate::RegionOutlives(ref pred) => pred.clean(cx),
932931
Predicate::TypeOutlives(ref pred) => pred.clean(cx),

0 commit comments

Comments
 (0)