Skip to content

Commit 791de9b

Browse files
committed
remove TODO, cause why not
1 parent 75772a8 commit 791de9b

File tree

11 files changed

+3
-24
lines changed

11 files changed

+3
-24
lines changed

src/librustc_mir/transform/qualify_min_const_fn.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ pub fn is_min_const_fn(tcx: TyCtxt<'tcx>, def_id: DefId, body: &'a Body<'tcx>) -
2323
loop {
2424
let predicates = tcx.predicates_of(current);
2525
for (predicate, _) in predicates.predicates {
26-
// TODO: forall
2726
match predicate.ignore_qualifiers(tcx).skip_binder().kind() {
2827
ty::PredicateKind::ForAll(_) => bug!("unexpected predicate: {:?}", predicate),
2928
ty::PredicateKind::RegionOutlives(_)

src/librustc_trait_selection/traits/auto_trait.rs

-1
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,6 @@ impl AutoTraitFinder<'tcx> {
639639
// We check this by calling is_of_param on the relevant types
640640
// from the various possible predicates
641641

642-
// TODO: forall
643642
match predicate.ignore_qualifiers(self.tcx).skip_binder().kind() {
644643
&ty::PredicateKind::Trait(p, _) => {
645644
if self.is_param_no_infer(p.trait_ref.substs)

src/librustc_trait_selection/traits/error_reporting/mod.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
255255
return;
256256
}
257257

258-
// TODO: forall
259258
match obligation.predicate.ignore_qualifiers(tcx).skip_binder().kind() {
260259
ty::PredicateKind::ForAll(_) => {
261260
bug!("unexpected predicate: {:?}", obligation.predicate)
@@ -1455,7 +1454,6 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
14551454
return;
14561455
}
14571456

1458-
// TODO: forall
14591457
let mut err = match predicate.ignore_qualifiers(self.tcx).skip_binder().kind() {
14601458
&ty::PredicateKind::Trait(data, _) => {
14611459
let trait_ref = ty::Binder::bind(data.trait_ref);
@@ -1557,8 +1555,6 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
15571555
}
15581556

15591557
ty::PredicateKind::WellFormed(arg) => {
1560-
// TODO: forall
1561-
15621558
// Same hacky approach as above to avoid deluging user
15631559
// with error messages.
15641560
if arg.references_error() || self.tcx.sess.has_errors() {
@@ -1578,12 +1574,11 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
15781574
}
15791575
}
15801576

1581-
ty::PredicateKind::Subtype(ref data) => {
1577+
ty::PredicateKind::Subtype(data) => {
15821578
if data.references_error() || self.tcx.sess.has_errors() {
15831579
// no need to overload user in such cases
15841580
return;
15851581
}
1586-
// TODO: forall
15871582
let &SubtypePredicate { a_is_expected: _, a, b } = data;
15881583
// both must be type variables, or the other would've been instantiated
15891584
assert!(a.is_ty_var() && b.is_ty_var());

src/librustc_trait_selection/traits/object_safety.rs

-2
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ fn predicates_reference_self(
245245
.iter()
246246
.map(|(predicate, sp)| (predicate.subst_supertrait(tcx, &trait_ref), sp))
247247
.filter_map(|(predicate, &sp)| {
248-
// TODO: forall
249248
match predicate.ignore_qualifiers(tcx).skip_binder().kind() {
250249
ty::PredicateKind::Trait(ref data, _) => {
251250
// In the case of a trait predicate, we can skip the "self" type.
@@ -300,7 +299,6 @@ fn generics_require_sized_self(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
300299
let predicates = tcx.predicates_of(def_id);
301300
let predicates = predicates.instantiate_identity(tcx).predicates;
302301
elaborate_predicates(tcx, predicates.into_iter()).any(|obligation| {
303-
// TODO: forall
304302
match obligation.predicate.ignore_qualifiers(tcx).skip_binder().kind() {
305303
ty::PredicateKind::Trait(ref trait_pred, _) => {
306304
trait_pred.def_id() == sized_def_id && trait_pred.self_ty().is_param(0)

src/librustc_trait_selection/traits/project.rs

-2
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,6 @@ fn assemble_candidates_from_predicates<'cx, 'tcx>(
932932
let infcx = selcx.infcx();
933933
for predicate in env_predicates {
934934
debug!("assemble_candidates_from_predicates: predicate={:?}", predicate);
935-
// TODO: forall
936935
if let &ty::PredicateKind::Projection(data) =
937936
predicate.ignore_qualifiers(infcx.tcx).skip_binder().kind()
938937
{
@@ -1227,7 +1226,6 @@ fn confirm_object_candidate<'cx, 'tcx>(
12271226
// select only those projections that are actually projecting an
12281227
// item with the correct name
12291228

1230-
// TODO: forall
12311229
let env_predicates = env_predicates.filter_map(|o| {
12321230
match o.predicate.ignore_qualifiers(selcx.tcx()).skip_binder().kind() {
12331231
&ty::PredicateKind::Projection(data)

src/librustc_trait_selection/traits/select/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
408408
None => self.check_recursion_limit(&obligation, &obligation)?,
409409
}
410410

411-
// TODO: forall
412411
match obligation.predicate.ignore_qualifiers(self.tcx()).skip_binder().kind() {
413412
ty::PredicateKind::ForAll(_) => {
414413
bug!("unexpected predicate: {:?}", obligation.predicate)

src/librustc_traits/normalize_erasing_regions.rs

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ fn normalize_generic_arg_after_erasing_regions<'tcx>(
4242
}
4343

4444
fn not_outlives_predicate(tcx: TyCtxt<'tcx>, p: &ty::Predicate<'tcx>) -> bool {
45-
// TODO: forall
4645
match p.ignore_qualifiers(tcx).skip_binder().kind() {
4746
ty::PredicateKind::RegionOutlives(..) | ty::PredicateKind::TypeOutlives(..) => false,
4847
ty::PredicateKind::ForAll(_) => bug!("unexpected predicate: {:?}", p),

src/librustc_typeck/astconv.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
17061706
obligation.predicate
17071707
);
17081708

1709-
// TODO: forall
17101709
match obligation.predicate.ignore_qualifiers(tcx).skip_binder().kind() {
17111710
&ty::PredicateKind::Trait(pred, _) => {
17121711
let pred = ty::Binder::bind(pred);

src/librustc_typeck/check/method/suggest.rs

-1
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
631631
}
632632
};
633633
let mut format_pred = |pred: ty::Predicate<'tcx>| {
634-
// TODO: forall
635634
match pred.ignore_qualifiers(tcx).skip_binder().kind() {
636635
&ty::PredicateKind::Projection(pred) => {
637636
let pred = ty::Binder::bind(pred);

src/librustc_typeck/check/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -2388,8 +2388,6 @@ fn bounds_from_generic_predicates<'tcx>(
23882388
let mut projections = vec![];
23892389
for (predicate, _) in predicates.predicates {
23902390
debug!("predicate {:?}", predicate);
2391-
// TODO: forall (we could keep the current behavior and just skip binders eagerly,
2392-
// not sure if we want to though)
23932391
match predicate.ignore_qualifiers(tcx).skip_binder().kind() {
23942392
ty::PredicateKind::Trait(trait_predicate, _) => {
23952393
let entry = types.entry(trait_predicate.self_ty()).or_default();
@@ -3864,7 +3862,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
38643862
.borrow()
38653863
.pending_obligations()
38663864
.into_iter()
3867-
// TODO: forall
38683865
.filter_map(move |obligation| {
38693866
match obligation.predicate.ignore_qualifiers(self.tcx).skip_binder().kind() {
38703867
ty::PredicateKind::ForAll(_) => {

src/librustc_typeck/outlives/explicit.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@ impl<'tcx> ExplicitPredicatesMap<'tcx> {
2929

3030
// process predicates and convert to `RequiredPredicates` entry, see below
3131
for &(predicate, span) in predicates.predicates {
32-
// TODO: forall
3332
match predicate.ignore_qualifiers(tcx).skip_binder().kind() {
3433
ty::PredicateKind::ForAll(_) => bug!("unepected predicate: {:?}", predicate),
3534

36-
ty::PredicateKind::TypeOutlives(predicate) => {
37-
let OutlivesPredicate(ref ty, ref reg) = predicate;
35+
ty::PredicateKind::TypeOutlives(OutlivesPredicate(ref ty, ref reg)) => {
3836
insert_outlives_predicate(
3937
tcx,
4038
(*ty).into(),
@@ -44,8 +42,7 @@ impl<'tcx> ExplicitPredicatesMap<'tcx> {
4442
)
4543
}
4644

47-
ty::PredicateKind::RegionOutlives(predicate) => {
48-
let OutlivesPredicate(ref reg1, ref reg2) = predicate;
45+
ty::PredicateKind::RegionOutlives(OutlivesPredicate(ref reg1, ref reg2)) => {
4946
insert_outlives_predicate(
5047
tcx,
5148
(*reg1).into(),

0 commit comments

Comments
 (0)