Skip to content

Commit 7ddafaf

Browse files
author
Samy Kacimi
committed
normalize use of backticks in compiler messages for libsyntax/parse
#60532
1 parent 4b65a86 commit 7ddafaf

8 files changed

+8
-8
lines changed

src/libsyntax/parse/attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ impl<'a> Parser<'a> {
226226

227227
fn parse_unsuffixed_lit(&mut self) -> PResult<'a, ast::Lit> {
228228
let lit = self.parse_lit()?;
229-
debug!("Checking if {:?} is unusuffixed.", lit);
229+
debug!("checking if {:?} is unusuffixed", lit);
230230

231231
if !lit.node.is_unsuffixed() {
232232
let msg = "suffixed literals are not allowed in attributes";

src/libsyntax/parse/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ impl<'a> Parser<'a> {
919919
Applicability::MaybeIncorrect,
920920
);
921921
} else {
922-
err.note("#![feature(type_ascription)] lets you annotate an \
922+
err.note("`#![feature(type_ascription)]` lets you annotate an \
923923
expression with a type: `<expr>: <type>`")
924924
.span_note(
925925
lhs_span,

src/libsyntax/parse/lexer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ impl<'a> StringReader<'a> {
443443

444444
let is_beginning_of_file = self.pos == self.source_file.start_pos;
445445
if is_beginning_of_file {
446-
debug!("Skipping a shebang");
446+
debug!("skipping a shebang");
447447
let start = self.pos;
448448
while !self.ch_is('\n') && !self.is_eof() {
449449
self.bump();

src/test/ui/issues/issue-22644.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ error: expected type, found `4`
8989
LL | println!("{}", a: &mut 4);
9090
| ^ expecting a type here because of type ascription
9191
|
92-
= note: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
92+
= note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
9393
note: this expression expects an ascribed type after the colon
9494
--> $DIR/issue-22644.rs:34:20
9595
|

src/test/ui/issues/issue-34255-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: expected type, found `42`
44
LL | Test::Drill(field: 42);
55
| ^^ expecting a type here because of type ascription
66
|
7-
= note: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
7+
= note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
88
note: this expression expects an ascribed type after the colon
99
--> $DIR/issue-34255-1.rs:8:17
1010
|

src/test/ui/lifetime_starts_expressions.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ error: expected type, found keyword `loop`
1414
LL | loop { break 'label: loop { break 'label 42; }; }
1515
| ^^^^ expecting a type here because of type ascription
1616
|
17-
= note: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
17+
= note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
1818
note: this expression expects an ascribed type after the colon
1919
--> $DIR/lifetime_starts_expressions.rs:6:12
2020
|

src/test/ui/parser/recover-from-bad-variant.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: expected type, found `3`
44
LL | let x = Enum::Foo(a: 3, b: 4);
55
| ^ expecting a type here because of type ascription
66
|
7-
= note: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
7+
= note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
88
note: this expression expects an ascribed type after the colon
99
--> $DIR/recover-from-bad-variant.rs:7:23
1010
|

src/test/ui/type/type-ascription-instead-of-statement-end.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ error: expected type, found `0`
1212
LL | println!("test"): 0;
1313
| ^ expecting a type here because of type ascription
1414
|
15-
= note: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
15+
= note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
1616
note: this expression expects an ascribed type after the colon
1717
--> $DIR/type-ascription-instead-of-statement-end.rs:9:5
1818
|

0 commit comments

Comments
 (0)