1
Fork 0

Consider negative polarity on overlap check

This commit is contained in:
Santiago Pastorino 2021-10-12 12:11:00 -03:00
parent 6975afd141
commit 8b0bfb0dcb
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
6 changed files with 46 additions and 19 deletions

View file

@ -12,7 +12,7 @@ use rustc_hir::def_id::DefId;
use rustc_query_system::cache::Cache;
pub type SelectionCache<'tcx> = Cache<
ty::ConstnessAnd<ty::ParamEnvAnd<'tcx, ty::TraitRef<'tcx>>>,
(ty::ConstnessAnd<ty::ParamEnvAnd<'tcx, ty::TraitRef<'tcx>>>, ty::ImplPolarity),
SelectionResult<'tcx, SelectionCandidate<'tcx>>,
>;
@ -101,7 +101,7 @@ pub enum SelectionCandidate<'tcx> {
/// `false` if there are no *further* obligations.
has_nested: bool,
},
ParamCandidate(ty::ConstnessAnd<ty::PolyTraitRef<'tcx>>),
ParamCandidate((ty::ConstnessAnd<ty::PolyTraitRef<'tcx>>, ty::ImplPolarity)),
ImplCandidate(DefId),
AutoImplCandidate(DefId),