@@ -661,7 +661,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
661661 } ,
662662 ObligationCauseCode :: IfExpression ( box IfExpressionCause { then, outer, semicolon } ) => {
663663 err. span_label ( then, "expected because of this" ) ;
664- outer. map ( |sp| err. span_label ( sp, "if and else have incompatible types" ) ) ;
664+ outer. map ( |sp| err. span_label ( sp, "`if` and ` else` have incompatible types" ) ) ;
665665 if let Some ( sp) = semicolon {
666666 err. span_suggestion_short (
667667 sp,
@@ -1883,13 +1883,13 @@ impl<'tcx> ObligationCause<'tcx> {
18831883 hir:: MatchSource :: TryDesugar => {
18841884 "try expression alternatives have incompatible types"
18851885 }
1886- _ => "match arms have incompatible types" ,
1886+ _ => "` match` arms have incompatible types" ,
18871887 } )
18881888 }
1889- IfExpression { .. } => Error0308 ( "if and else have incompatible types" ) ,
1890- IfExpressionWithNoElse => Error0317 ( "if may be missing an else clause" ) ,
1891- MainFunctionType => Error0580 ( "main function has wrong type" ) ,
1892- StartFunctionType => Error0308 ( "start function has wrong type" ) ,
1889+ IfExpression { .. } => Error0308 ( "`if` and ` else` have incompatible types" ) ,
1890+ IfExpressionWithNoElse => Error0317 ( "`if` may be missing an ` else` clause" ) ,
1891+ MainFunctionType => Error0580 ( "` main` function has wrong type" ) ,
1892+ StartFunctionType => Error0308 ( "`#[ start]` function has wrong type" ) ,
18931893 IntrinsicType => Error0308 ( "intrinsic has wrong type" ) ,
18941894 MethodReceiver => Error0308 ( "mismatched `self` parameter type" ) ,
18951895
@@ -1917,12 +1917,12 @@ impl<'tcx> ObligationCause<'tcx> {
19171917 ExprAssignable => "expression is assignable" ,
19181918 MatchExpressionArm ( box MatchExpressionArmCause { source, .. } ) => match source {
19191919 hir:: MatchSource :: IfLetDesugar { .. } => "`if let` arms have compatible types" ,
1920- _ => "match arms have compatible types" ,
1920+ _ => "` match` arms have compatible types" ,
19211921 } ,
1922- IfExpression { .. } => "if and else have incompatible types" ,
1923- IfExpressionWithNoElse => "if missing an else returns () " ,
1922+ IfExpression { .. } => "`if` and ` else` have incompatible types" ,
1923+ IfExpressionWithNoElse => "`if` missing an ` else` returns `()` " ,
19241924 MainFunctionType => "`main` function has the correct type" ,
1925- StartFunctionType => "`start` function has the correct type" ,
1925+ StartFunctionType => "`#[ start] ` function has the correct type" ,
19261926 IntrinsicType => "intrinsic has the correct type" ,
19271927 MethodReceiver => "method receiver has the correct type" ,
19281928 _ => "types are compatible" ,
0 commit comments