Skip to content

Commit d3cf813

Browse files
committed
Use field-less variant for AliasBound.
1 parent d4a816c commit d3cf813

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

compiler/rustc_trait_selection/src/solve/assembly.rs

+3-4
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(),
79+
AliasBound,
8080
}
8181

8282
pub(super) trait GoalKind<'tcx>: TypeFoldable<'tcx> + Copy + Eq {
@@ -340,15 +340,14 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
340340
ty::Alias(_, alias_ty) => alias_ty,
341341
};
342342

343-
for (_, (assumption, _)) in self
343+
for (assumption, _) in self
344344
.tcx()
345345
.bound_explicit_item_bounds(alias_ty.def_id)
346346
.subst_iter_copied(self.tcx(), alias_ty.substs)
347-
.enumerate()
348347
{
349348
match G::consider_assumption(self, goal, assumption) {
350349
Ok(result) => {
351-
candidates.push(Candidate { source: CandidateSource::AliasBound(), result })
350+
candidates.push(Candidate { source: CandidateSource::AliasBound, result })
352351
}
353352
Err(NoSolution) => (),
354353
}

compiler/rustc_trait_selection/src/solve/project_goals.rs

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

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