Make the derived obligation cause parent private

This commit is contained in:
Oli Scherer
2022-05-10 11:10:27 +00:00
parent 5b5b549580
commit 9ba6ddb929
4 changed files with 21 additions and 14 deletions

View File

@@ -497,7 +497,15 @@ pub struct DerivedObligationCause<'tcx> {
pub parent_trait_pred: ty::PolyTraitPredicate<'tcx>,
/// The parent trait had this cause.
pub parent_code: Lrc<ObligationCauseCode<'tcx>>,
parent_code: Lrc<ObligationCauseCode<'tcx>>,
}
impl<'tcx> DerivedObligationCause<'tcx> {
/// Get a reference to the derived obligation cause's parent code.
#[must_use]
pub fn parent_code(&self) -> &ObligationCauseCode<'tcx> {
self.parent_code.as_ref()
}
}
#[derive(Clone, Debug, TypeFoldable, Lift)]