Use ObligationCtxt in favor of TraitEngine in many places
This commit is contained in:
parent
79734f1db8
commit
d9eb5232b6
9 changed files with 142 additions and 113 deletions
|
@ -206,6 +206,18 @@ impl<'tcx> FulfillmentError<'tcx> {
|
|||
) -> FulfillmentError<'tcx> {
|
||||
FulfillmentError { obligation, code, root_obligation }
|
||||
}
|
||||
|
||||
pub fn is_true_error(&self) -> bool {
|
||||
match self.code {
|
||||
FulfillmentErrorCode::SelectionError(_)
|
||||
| FulfillmentErrorCode::ProjectionError(_)
|
||||
| FulfillmentErrorCode::SubtypeError(_, _)
|
||||
| FulfillmentErrorCode::ConstEquateError(_, _) => true,
|
||||
FulfillmentErrorCode::Cycle(_) | FulfillmentErrorCode::Ambiguity { overflow: _ } => {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> PolyTraitObligation<'tcx> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue