Use field-less variant for AliasBound.

This commit is contained in:
Lenko Donchev 2023-01-28 06:00:27 -06:00
parent d4a816c813
commit d3cf813b8d
3 changed files with 5 additions and 6 deletions

View File

@ -76,7 +76,7 @@ pub(super) enum CandidateSource {
/// let _y = x.clone();
/// }
/// ```
AliasBound(),
AliasBound,
}
pub(super) trait GoalKind<'tcx>: TypeFoldable<'tcx> + Copy + Eq {
@ -340,15 +340,14 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
ty::Alias(_, alias_ty) => alias_ty,
};
for (_, (assumption, _)) in self
for (assumption, _) in self
.tcx()
.bound_explicit_item_bounds(alias_ty.def_id)
.subst_iter_copied(self.tcx(), alias_ty.substs)
.enumerate()
{
match G::consider_assumption(self, goal, assumption) {
Ok(result) => {
candidates.push(Candidate { source: CandidateSource::AliasBound(), result })
candidates.push(Candidate { source: CandidateSource::AliasBound, result })
}
Err(NoSolution) => (),
}

View File

@ -171,7 +171,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
(CandidateSource::Impl(_), _)
| (CandidateSource::ParamEnv(_), _)
| (CandidateSource::BuiltinImpl, _)
| (CandidateSource::AliasBound(), _) => unimplemented!(),
| (CandidateSource::AliasBound, _) => unimplemented!(),
}
}
}

View File

@ -320,7 +320,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
match (candidate.source, other.source) {
(CandidateSource::Impl(_), _)
| (CandidateSource::ParamEnv(_), _)
| (CandidateSource::AliasBound(), _)
| (CandidateSource::AliasBound, _)
| (CandidateSource::BuiltinImpl, _) => unimplemented!(),
}
}