@@ -661,7 +661,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
661
661
} ,
662
662
ObligationCauseCode :: IfExpression ( box IfExpressionCause { then, outer, semicolon } ) => {
663
663
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" ) ) ;
665
665
if let Some ( sp) = semicolon {
666
666
err. span_suggestion_short (
667
667
sp,
@@ -1883,13 +1883,13 @@ impl<'tcx> ObligationCause<'tcx> {
1883
1883
hir:: MatchSource :: TryDesugar => {
1884
1884
"try expression alternatives have incompatible types"
1885
1885
}
1886
- _ => "match arms have incompatible types" ,
1886
+ _ => "` match` arms have incompatible types" ,
1887
1887
} )
1888
1888
}
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" ) ,
1893
1893
IntrinsicType => Error0308 ( "intrinsic has wrong type" ) ,
1894
1894
MethodReceiver => Error0308 ( "mismatched `self` parameter type" ) ,
1895
1895
@@ -1917,12 +1917,12 @@ impl<'tcx> ObligationCause<'tcx> {
1917
1917
ExprAssignable => "expression is assignable" ,
1918
1918
MatchExpressionArm ( box MatchExpressionArmCause { source, .. } ) => match source {
1919
1919
hir:: MatchSource :: IfLetDesugar { .. } => "`if let` arms have compatible types" ,
1920
- _ => "match arms have compatible types" ,
1920
+ _ => "` match` arms have compatible types" ,
1921
1921
} ,
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 `()` " ,
1924
1924
MainFunctionType => "`main` function has the correct type" ,
1925
- StartFunctionType => "`start` function has the correct type" ,
1925
+ StartFunctionType => "`#[ start] ` function has the correct type" ,
1926
1926
IntrinsicType => "intrinsic has the correct type" ,
1927
1927
MethodReceiver => "method receiver has the correct type" ,
1928
1928
_ => "types are compatible" ,
0 commit comments