1
Fork 0

Split out ImplPolarity and PredicatePolarity

This commit is contained in:
Michael Goulet 2024-03-21 15:45:28 -04:00
parent 1447f9d38c
commit 4b87c0b9c9
30 changed files with 169 additions and 95 deletions

View file

@ -719,6 +719,18 @@ impl<'tcx> Stable<'tcx> for ty::ImplPolarity {
}
}
impl<'tcx> Stable<'tcx> for ty::PredicatePolarity {
type T = stable_mir::ty::PredicatePolarity;
fn stable(&self, _: &mut Tables<'_>) -> Self::T {
use rustc_middle::ty::PredicatePolarity::*;
match self {
Positive => stable_mir::ty::PredicatePolarity::Positive,
Negative => stable_mir::ty::PredicatePolarity::Negative,
}
}
}
impl<'tcx> Stable<'tcx> for ty::Region<'tcx> {
type T = stable_mir::ty::Region;