Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit eeb6447

Browse files
committedMar 30, 2017
add an ObligationCauseCode we'll use later (ReturnNoExpression)
1 parent 27f4b57 commit eeb6447

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed
 

‎src/librustc/traits/error_reporting.rs

+1
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
904904
ObligationCauseCode::StartFunctionType |
905905
ObligationCauseCode::IntrinsicType |
906906
ObligationCauseCode::MethodReceiver |
907+
ObligationCauseCode::ReturnNoExpression |
907908
ObligationCauseCode::MiscObligation => {
908909
}
909910
ObligationCauseCode::SliceOrArrayElem => {

‎src/librustc/traits/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ pub enum ObligationCauseCode<'tcx> {
173173

174174
// method receiver
175175
MethodReceiver,
176+
177+
// `return` with no expression
178+
ReturnNoExpression,
176179
}
177180

178181
#[derive(Clone, Debug, PartialEq, Eq)]

‎src/librustc/traits/structural_impls.rs

+3
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ impl<'a, 'tcx> Lift<'tcx> for traits::ObligationCauseCode<'a> {
167167
type Lifted = traits::ObligationCauseCode<'tcx>;
168168
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'b, 'gcx, 'tcx>) -> Option<Self::Lifted> {
169169
match *self {
170+
super::ReturnNoExpression => Some(super::ReturnNoExpression),
170171
super::MiscObligation => Some(super::MiscObligation),
171172
super::SliceOrArrayElem => Some(super::SliceOrArrayElem),
172173
super::TupleElem => Some(super::TupleElem),
@@ -489,6 +490,7 @@ impl<'tcx> TypeFoldable<'tcx> for traits::ObligationCauseCode<'tcx> {
489490
super::StructInitializerSized |
490491
super::VariableType(_) |
491492
super::ReturnType |
493+
super::ReturnNoExpression |
492494
super::RepeatVec |
493495
super::FieldSized |
494496
super::ConstSized |
@@ -533,6 +535,7 @@ impl<'tcx> TypeFoldable<'tcx> for traits::ObligationCauseCode<'tcx> {
533535
super::StructInitializerSized |
534536
super::VariableType(_) |
535537
super::ReturnType |
538+
super::ReturnNoExpression |
536539
super::RepeatVec |
537540
super::FieldSized |
538541
super::ConstSized |

0 commit comments

Comments
 (0)
Please sign in to comment.