]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_parse/src/parser/mod.rs
Auto merge of #98402 - cjgillot:undead, r=michaelwoerister
[rust.git] / compiler / rustc_parse / src / parser / mod.rs
index acdf121522ad9e635613857bc7318beee1145919..00002f6f59bc1705065f541c4cb2efb39cf0637a 100644 (file)
@@ -891,22 +891,19 @@ fn recover_missing_braces_around_closure_body(
         let mut first_note = MultiSpan::from(vec![initial_semicolon]);
         first_note.push_span_label(
             initial_semicolon,
-            "this `;` turns the preceding closure into a statement".to_string(),
+            "this `;` turns the preceding closure into a statement",
         );
         first_note.push_span_label(
             closure_spans.body,
-            "this expression is a statement because of the trailing semicolon".to_string(),
+            "this expression is a statement because of the trailing semicolon",
         );
         expect_err.span_note(first_note, "statement found outside of a block");
 
         let mut second_note = MultiSpan::from(vec![closure_spans.whole_closure]);
-        second_note.push_span_label(
-            closure_spans.whole_closure,
-            "this is the parsed closure...".to_string(),
-        );
+        second_note.push_span_label(closure_spans.whole_closure, "this is the parsed closure...");
         second_note.push_span_label(
             following_token_span,
-            "...but likely you meant the closure to end here".to_string(),
+            "...but likely you meant the closure to end here",
         );
         expect_err.span_note(second_note, "the closure body may be incorrectly delimited");