Add TraitObligation::polarity() for better encapsulation
This commit is contained in:
parent
7568632513
commit
68d444ffa1
3 changed files with 12 additions and 14 deletions
|
@ -140,6 +140,10 @@ impl<'tcx> FulfillmentError<'tcx> {
|
|||
}
|
||||
|
||||
impl<'tcx> TraitObligation<'tcx> {
|
||||
pub fn polarity(&self) -> ty::ImplPolarity {
|
||||
self.predicate.skip_binder().polarity
|
||||
}
|
||||
|
||||
pub fn self_ty(&self) -> ty::Binder<'tcx, Ty<'tcx>> {
|
||||
self.predicate.map_bound(|p| p.self_ty())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue