Skip to content

Commit 9ce04e3

Browse files
committed
merge diagnostics about incorrect uses of .await
1 parent a06ba45 commit 9ce04e3

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

compiler/rustc_error_messages/locales/en-US/parser.ftl

+2-6
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,5 @@ parser-incorrect-semicolon =
2626
2727
parser-incorrect-use-of-await =
2828
incorrect use of `await`
29-
.suggestion = `await` is not a method call, remove the parentheses
30-
31-
32-
parser-incorrect-await =
33-
incorrect use of `await`
34-
.suggestion = `await` is a postfix operation
29+
.parentheses-suggestion = `await` is not a method call, remove the parentheses
30+
.postfix-suggestion = `await` is a postfix operation

compiler/rustc_parse/src/parser/diagnostics.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -310,16 +310,16 @@ struct IncorrectSemicolon<'a> {
310310
#[error(slug = "parser-incorrect-use-of-await")]
311311
struct IncorrectUseOfAwait {
312312
#[primary_span]
313-
#[suggestion(applicability = "machine-applicable")]
313+
#[suggestion(message = "parentheses-suggestion", applicability = "machine-applicable")]
314314
span: Span,
315315
}
316316

317317
#[derive(SessionDiagnostic)]
318-
#[error(slug = "parser-incorrect-await")]
318+
#[error(slug = "parser-incorrect-use-of-await")]
319319
struct IncorrectAwait {
320320
#[primary_span]
321321
span: Span,
322-
#[suggestion(code = "{expr}.await{question_mark}")]
322+
#[suggestion(message = "postfix-suggestion", code = "{expr}.await{question_mark}")]
323323
sugg_span: (Span, Applicability),
324324
expr: String,
325325
question_mark: &'static str,

0 commit comments

Comments
 (0)