Skip to content

Commit d4a816c

Browse files
committed
remove the usize field from CandidateSource::AliasBound
1 parent 7d4df2d commit d4a816c

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

compiler/rustc_trait_selection/src/solve/assembly.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub(super) enum CandidateSource {
7676
/// let _y = x.clone();
7777
/// }
7878
/// ```
79-
AliasBound(usize),
79+
AliasBound(),
8080
}
8181

8282
pub(super) trait GoalKind<'tcx>: TypeFoldable<'tcx> + Copy + Eq {
@@ -217,8 +217,6 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
217217
// NOTE: Alternatively we could call `evaluate_goal` here and only have a `Normalized` candidate.
218218
// This doesn't work as long as we use `CandidateSource` in winnowing.
219219
let goal = goal.with(tcx, goal.predicate.with_self_ty(tcx, normalized_ty));
220-
// FIXME: This is broken if we care about the `usize` of `AliasBound` because the self type
221-
// could be normalized to yet another projection with different item bounds.
222220
let normalized_candidates = self.assemble_and_evaluate_candidates(goal);
223221
for mut normalized_candidate in normalized_candidates {
224222
normalized_candidate.result =
@@ -342,15 +340,15 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
342340
ty::Alias(_, alias_ty) => alias_ty,
343341
};
344342

345-
for (i, (assumption, _)) in self
343+
for (_, (assumption, _)) in self
346344
.tcx()
347345
.bound_explicit_item_bounds(alias_ty.def_id)
348346
.subst_iter_copied(self.tcx(), alias_ty.substs)
349347
.enumerate()
350348
{
351349
match G::consider_assumption(self, goal, assumption) {
352350
Ok(result) => {
353-
candidates.push(Candidate { source: CandidateSource::AliasBound(i), result })
351+
candidates.push(Candidate { source: CandidateSource::AliasBound(), result })
354352
}
355353
Err(NoSolution) => (),
356354
}

compiler/rustc_trait_selection/src/solve/project_goals.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
171171
(CandidateSource::Impl(_), _)
172172
| (CandidateSource::ParamEnv(_), _)
173173
| (CandidateSource::BuiltinImpl, _)
174-
| (CandidateSource::AliasBound(_), _) => unimplemented!(),
174+
| (CandidateSource::AliasBound(), _) => unimplemented!(),
175175
}
176176
}
177177
}

compiler/rustc_trait_selection/src/solve/trait_goals.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
320320
match (candidate.source, other.source) {
321321
(CandidateSource::Impl(_), _)
322322
| (CandidateSource::ParamEnv(_), _)
323-
| (CandidateSource::AliasBound(_), _)
323+
| (CandidateSource::AliasBound(), _)
324324
| (CandidateSource::BuiltinImpl, _) => unimplemented!(),
325325
}
326326
}

0 commit comments

Comments
 (0)