Skip to content

Commit 81ced87

Browse files
committed
More cleanup
1 parent ac05bf2 commit 81ced87

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

compiler/rustc_borrowck/src/eliminate_placeholders.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@ pub(crate) fn rewrite_higher_kinded_outlives_as_constraints<'tcx>(
450450
scc_annotations[sccs.scc(r1)].min_universe() != scc_annotations[sccs.scc(r2)].min_universe()
451451
};
452452

453-
// FIXME(amandasystems) it's probably better to destroy and recreate the member constraints from scratch.
454453
let member_constraints = member_constraints.into_mapped(
455454
|r| sccs.scc(r),
456455
|r| scc_annotations[sccs.scc(r)].in_root_universe(),
@@ -540,9 +539,8 @@ fn rewrite_outlives<'tcx>(
540539
outlives_static
541540
}
542541

542+
// FIXME this is at least partially duplicated code to the constraint search in `region_infer`.
543543
/// Find a region matching a predicate in a set of constraints, using BFS.
544-
// FIXME(amandasystems) this is at least partially duplicated code to the constraint search in `region_infer`.
545-
// It's probably also very expensive.
546544
fn find_region<'tcx>(
547545
constraints: &OutlivesConstraintSet<'tcx>,
548546
graph: &ConstraintGraph<Normal>,

compiler/rustc_borrowck/src/nll.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ pub(crate) fn compute_regions<'a, 'tcx>(
131131
&constraints,
132132
);
133133

134-
// FIXME(amandasystems) Polonius should happen *after* the constraint rewrite!
135134
let var_infos = infcx.get_region_var_infos();
136135
let MirTypeckRegionConstraints {
137136
liveness_constraints,

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
705705
) -> Option<RegionErrorKind<'tcx>> {
706706
let bound_failure = verify_bound.either(
707707
|verify_bound| {
708-
if self.eval_verify_bound(infcx, generic_kind, lower_bound, verify_bound) {
708+
if self.eval_verify_bound(
709+
infcx,
710+
generic_kind.to_ty(infcx.tcx),
711+
lower_bound,
712+
verify_bound,
713+
) {
709714
None
710715
} else {
711716
Some(RegionErrorKind::TypeTestError {
@@ -1024,7 +1029,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
10241029
fn eval_rewritten_verify_bound(
10251030
&self,
10261031
infcx: &InferCtxt<'tcx>,
1027-
generic_kind: &GenericKind<'tcx>, // FIXME(amandasystems): make into Generic_ty
1032+
generic_kind: &GenericKind<'tcx>,
10281033
lower_bound: RegionVid,
10291034
verify_bound: &RewrittenVerifyBound<'tcx>,
10301035
span: Span,
@@ -1040,8 +1045,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
10401045
|verify_bound: &Either<VerifyBound<'tcx>, RewrittenVerifyBound<'tcx>>| {
10411046
verify_bound.as_ref().either(
10421047
|verify_bound| {
1043-
let bound_fails =
1044-
!self.eval_verify_bound(infcx, generic_kind, lower_bound, verify_bound);
1048+
let bound_fails = !self.eval_verify_bound(
1049+
infcx,
1050+
generic_kind.to_ty(infcx.tcx),
1051+
lower_bound,
1052+
verify_bound,
1053+
);
10451054
bound_fails.then(|| bound_fails_due_to_static(false))
10461055
},
10471056
|rewritten| {
@@ -1105,13 +1114,13 @@ impl<'tcx> RegionInferenceContext<'tcx> {
11051114
fn eval_verify_bound(
11061115
&self,
11071116
infcx: &InferCtxt<'tcx>,
1108-
generic_kind: &GenericKind<'tcx>, // FIXME(amandasystems): make into Generic_ty
1117+
generic_ty: Ty<'tcx>,
11091118
lower_bound: RegionVid,
11101119
verify_bound: &VerifyBound<'tcx>,
11111120
) -> bool {
11121121
match verify_bound {
11131122
VerifyBound::IfEq(verify_if_eq_b) => {
1114-
self.eval_if_eq(infcx, generic_kind.to_ty(infcx.tcx), lower_bound, *verify_if_eq_b)
1123+
self.eval_if_eq(infcx, generic_ty, lower_bound, *verify_if_eq_b)
11151124
}
11161125

11171126
VerifyBound::IsEmpty => {
@@ -1125,11 +1134,11 @@ impl<'tcx> RegionInferenceContext<'tcx> {
11251134
}
11261135

11271136
VerifyBound::AnyBound(verify_bounds) => verify_bounds.iter().any(|verify_bound| {
1128-
self.eval_verify_bound(infcx, generic_kind, lower_bound, verify_bound)
1137+
self.eval_verify_bound(infcx, generic_ty, lower_bound, verify_bound)
11291138
}),
11301139

11311140
VerifyBound::AllBounds(verify_bounds) => verify_bounds.iter().all(|verify_bound| {
1132-
self.eval_verify_bound(infcx, generic_kind, lower_bound, verify_bound)
1141+
self.eval_verify_bound(infcx, generic_ty, lower_bound, verify_bound)
11331142
}),
11341143
}
11351144
}
@@ -1899,7 +1908,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
18991908
| NllRegionVariableOrigin::Existential { from_forall: true } => false,
19001909
};
19011910

1902-
// FIXME(amandasystems) This closure is tooe big to inline, it should be a method if plausible.
19031911
// To pick a constraint to blame, we organize constraints by how interesting we expect them
19041912
// to be in diagnostics, then pick the most interesting one closest to either the source or
19051913
// the target on our constraint path.

0 commit comments

Comments
 (0)