Skip to content

Commit 99c46c0

Browse files
author
Sasha Pourcelot
committed
Slightly reword the error message
1 parent f91161d commit 99c46c0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_parse/src/parser/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ impl<'a> Parser<'a> {
894894
let mut first_note = MultiSpan::from(vec![initial_semicolon]);
895895
first_note.push_span_label(
896896
initial_semicolon,
897-
"this `;` turns the preceding expression into a statement".to_string(),
897+
"this `;` turns the preceding closure into a statement".to_string(),
898898
);
899899
first_note.push_span_label(
900900
closure_spans.body,

src/test/ui/expr/malformed_closure/missing_braces_around_block.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ note: statement found outside of a block
1111
--> $DIR/missing_braces_around_block.rs:16:26
1212
|
1313
LL | println!("{}", a);
14-
| -----------------^ this `;` turns the preceding expression into a statement
14+
| -----------------^ this `;` turns the preceding closure into a statement
1515
| |
1616
| this expression is a statement because of the trailing semicolon
1717
note: the closure body may be incorrectly delimited

0 commit comments

Comments
 (0)