Skip to content

Commit 55d6151

Browse files
committed
More cleanup
1 parent 6cc318b commit 55d6151

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

compiler/rustc_borrowck/src/eliminate_placeholders.rs

+1-3
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

-1
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

+17-9
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
707707
) -> Option<RegionErrorKind<'tcx>> {
708708
let bound_failure = verify_bound.either(
709709
|verify_bound| {
710-
if self.eval_verify_bound(infcx, generic_kind, lower_bound, verify_bound) {
710+
if self.eval_verify_bound(
711+
infcx,
712+
generic_kind.to_ty(infcx.tcx),
713+
lower_bound,
714+
verify_bound,
715+
) {
711716
None
712717
} else {
713718
Some(RegionErrorKind::TypeTestError {
@@ -1026,7 +1031,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
10261031
fn eval_rewritten_verify_bound(
10271032
&self,
10281033
infcx: &InferCtxt<'tcx>,
1029-
generic_kind: &GenericKind<'tcx>, // FIXME(amandasystems): make into Generic_ty
1034+
generic_kind: &GenericKind<'tcx>,
10301035
lower_bound: RegionVid,
10311036
verify_bound: &RewrittenVerifyBound<'tcx>,
10321037
span: Span,
@@ -1042,8 +1047,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
10421047
|verify_bound: &Either<VerifyBound<'tcx>, RewrittenVerifyBound<'tcx>>| {
10431048
verify_bound.as_ref().either(
10441049
|verify_bound| {
1045-
let bound_fails =
1046-
!self.eval_verify_bound(infcx, generic_kind, lower_bound, verify_bound);
1050+
let bound_fails = !self.eval_verify_bound(
1051+
infcx,
1052+
generic_kind.to_ty(infcx.tcx),
1053+
lower_bound,
1054+
verify_bound,
1055+
);
10471056
bound_fails.then(|| bound_fails_due_to_static(false))
10481057
},
10491058
|rewritten| {
@@ -1107,13 +1116,13 @@ impl<'tcx> RegionInferenceContext<'tcx> {
11071116
fn eval_verify_bound(
11081117
&self,
11091118
infcx: &InferCtxt<'tcx>,
1110-
generic_kind: &GenericKind<'tcx>, // FIXME(amandasystems): make into Generic_ty
1119+
generic_ty: Ty<'tcx>,
11111120
lower_bound: RegionVid,
11121121
verify_bound: &VerifyBound<'tcx>,
11131122
) -> bool {
11141123
match verify_bound {
11151124
VerifyBound::IfEq(verify_if_eq_b) => {
1116-
self.eval_if_eq(infcx, generic_kind.to_ty(infcx.tcx), lower_bound, *verify_if_eq_b)
1125+
self.eval_if_eq(infcx, generic_ty, lower_bound, *verify_if_eq_b)
11171126
}
11181127

11191128
VerifyBound::IsEmpty => {
@@ -1127,11 +1136,11 @@ impl<'tcx> RegionInferenceContext<'tcx> {
11271136
}
11281137

11291138
VerifyBound::AnyBound(verify_bounds) => verify_bounds.iter().any(|verify_bound| {
1130-
self.eval_verify_bound(infcx, generic_kind, lower_bound, verify_bound)
1139+
self.eval_verify_bound(infcx, generic_ty, lower_bound, verify_bound)
11311140
}),
11321141

11331142
VerifyBound::AllBounds(verify_bounds) => verify_bounds.iter().all(|verify_bound| {
1134-
self.eval_verify_bound(infcx, generic_kind, lower_bound, verify_bound)
1143+
self.eval_verify_bound(infcx, generic_ty, lower_bound, verify_bound)
11351144
}),
11361145
}
11371146
}
@@ -1926,7 +1935,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
19261935
| NllRegionVariableOrigin::Existential { from_forall: true } => false,
19271936
};
19281937

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

0 commit comments

Comments
 (0)