Skip to content

Commit 10a12c5

Browse files
authoredJan 5, 2020
Rollup merge of #67881 - varkor:scattering-of-backticks, r=Centril
Add backticks to various diagnostics
2 parents eae08b2 + 0c2cf07 commit 10a12c5

File tree

64 files changed

+115
-115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+115
-115
lines changed
 

‎src/librustc/infer/error_reporting/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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",

‎src/librustc_passes/entry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ fn find_item(item: &Item<'_>, ctxt: &mut EntryContext<'_, '_>, at_root: bool) {
134134
ctxt.start_fn = Some((item.hir_id, item.span));
135135
} else {
136136
struct_span_err!(ctxt.session, item.span, E0138, "multiple `start` functions")
137-
.span_label(ctxt.start_fn.unwrap().1, "previous `start` function here")
137+
.span_label(ctxt.start_fn.unwrap().1, "previous `#[start]` function here")
138138
.span_label(item.span, "multiple `start` functions")
139139
.emit();
140140
}

0 commit comments

Comments
 (0)