Skip to content

Commit 10a12c5

Browse files
authored
Rollup merge of rust-lang#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
}

src/librustc_target/spec/wasm32_base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub fn options() -> TargetOptions {
8181
dynamic_linking: true,
8282
only_cdylib: true,
8383

84-
// This means we'll just embed a `start` function in the wasm module
84+
// This means we'll just embed a `#[start]` function in the wasm module
8585
executables: true,
8686

8787
// relatively self-explanatory!

src/librustc_typeck/check/_match.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
298298
// LL || 10u32
299299
// || ^^^^^ expected `i32`, found `u32`
300300
// LL || };
301-
// ||_____- if and else have incompatible types
301+
// ||_____- `if` and `else` have incompatible types
302302
// ```
303303
Some(span)
304304
} else {
@@ -340,7 +340,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
340340
// by not pointing at the entire expression:
341341
// ```
342342
// 2 | let x = if true {
343-
// | ------- if and else have incompatible types
343+
// | ------- `if` and `else` have incompatible types
344344
// 3 | 3
345345
// | - expected because of this
346346
// 4 | } else {

src/libsyntax/feature_gate/check.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,8 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
387387
&self,
388388
start,
389389
i.span,
390-
"a `#[start]` function is an experimental \
391-
feature whose signature may change \
390+
"`#[start]` functions are experimental \
391+
and their signature may change \
392392
over time"
393393
);
394394
}

src/test/ui/async-await/issue-66387-if-without-else.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// edition:2018
22
async fn f() -> i32 {
3-
if true { //~ ERROR if may be missing an else clause
3+
if true { //~ ERROR `if` may be missing an `else` clause
44
return 0;
55
}
66
// An `if` block without `else` causes the type table not to have a type for this expr.

src/test/ui/async-await/issue-66387-if-without-else.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0317]: if may be missing an else clause
1+
error[E0317]: `if` may be missing an `else` clause
22
--> $DIR/issue-66387-if-without-else.rs:3:5
33
|
44
LL | / if true {

src/test/ui/bad/bad-expr-path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
mod m1 {}
22

3-
fn main(arguments: Vec<String>) { //~ ERROR main function has wrong type
3+
fn main(arguments: Vec<String>) { //~ ERROR `main` function has wrong type
44
log(debug, m1::arguments);
55
//~^ ERROR cannot find function `log` in this scope
66
//~| ERROR cannot find value `debug` in this scope

src/test/ui/bad/bad-expr-path.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ error[E0425]: cannot find value `arguments` in module `m1`
1616
LL | log(debug, m1::arguments);
1717
| ^^^^^^^^^ not found in `m1`
1818

19-
error[E0580]: main function has wrong type
19+
error[E0580]: `main` function has wrong type
2020
--> $DIR/bad-expr-path.rs:3:1
2121
|
2222
LL | fn main(arguments: Vec<String>) {

src/test/ui/bad/bad-expr-path2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ mod m1 {
22
pub mod arguments {}
33
}
44

5-
fn main(arguments: Vec<String>) { //~ ERROR main function has wrong type
5+
fn main(arguments: Vec<String>) { //~ ERROR `main` function has wrong type
66
log(debug, m1::arguments);
77
//~^ ERROR cannot find function `log` in this scope
88
//~| ERROR cannot find value `debug` in this scope

0 commit comments

Comments
 (0)