add an ObligationCauseCode
we'll use later (ReturnNoExpression
)
This commit is contained in:
parent
27f4b57602
commit
eeb6447bbf
@ -904,6 +904,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
|
||||
ObligationCauseCode::StartFunctionType |
|
||||
ObligationCauseCode::IntrinsicType |
|
||||
ObligationCauseCode::MethodReceiver |
|
||||
ObligationCauseCode::ReturnNoExpression |
|
||||
ObligationCauseCode::MiscObligation => {
|
||||
}
|
||||
ObligationCauseCode::SliceOrArrayElem => {
|
||||
|
@ -173,6 +173,9 @@ pub enum ObligationCauseCode<'tcx> {
|
||||
|
||||
// method receiver
|
||||
MethodReceiver,
|
||||
|
||||
// `return` with no expression
|
||||
ReturnNoExpression,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
|
@ -167,6 +167,7 @@ impl<'a, 'tcx> Lift<'tcx> for traits::ObligationCauseCode<'a> {
|
||||
type Lifted = traits::ObligationCauseCode<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'b, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
match *self {
|
||||
super::ReturnNoExpression => Some(super::ReturnNoExpression),
|
||||
super::MiscObligation => Some(super::MiscObligation),
|
||||
super::SliceOrArrayElem => Some(super::SliceOrArrayElem),
|
||||
super::TupleElem => Some(super::TupleElem),
|
||||
@ -489,6 +490,7 @@ impl<'tcx> TypeFoldable<'tcx> for traits::ObligationCauseCode<'tcx> {
|
||||
super::StructInitializerSized |
|
||||
super::VariableType(_) |
|
||||
super::ReturnType |
|
||||
super::ReturnNoExpression |
|
||||
super::RepeatVec |
|
||||
super::FieldSized |
|
||||
super::ConstSized |
|
||||
@ -533,6 +535,7 @@ impl<'tcx> TypeFoldable<'tcx> for traits::ObligationCauseCode<'tcx> {
|
||||
super::StructInitializerSized |
|
||||
super::VariableType(_) |
|
||||
super::ReturnType |
|
||||
super::ReturnNoExpression |
|
||||
super::RepeatVec |
|
||||
super::FieldSized |
|
||||
super::ConstSized |
|
||||
|
Loading…
Reference in New Issue
Block a user