about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2018-08-30 20:15:33 +0200
committerGitHub <noreply@github.com>2018-08-30 20:15:33 +0200
commit1535075b58bc725ea71dc0103bda5b840632e957 (patch)
tree816f67e16faea66a0c724b12df7a7f42afdf02ba /src/libsyntax/parse
parent1c36e767514f7b44060134f09a98bf4c6d19acfe (diff)
parent1f421d645633f600e85ecec60a56ac5b4c19335c (diff)
downloadrust-1535075b58bc725ea71dc0103bda5b840632e957.tar.gz
rust-1535075b58bc725ea71dc0103bda5b840632e957.zip
Rollup merge of #53655 - jcpst:with_applicability, r=estebank
set applicability

Update a few more calls as described in #50723

r? @estebank
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 1695d3a8f96..6c50b9c82f2 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -786,7 +786,12 @@ impl<'a> Parser<'a> {
         } else {
             err.span_label(self.span, "expected identifier");
             if self.token == token::Comma && self.look_ahead(1, |t| t.is_ident()) {
-                err.span_suggestion(self.span, "remove this comma", String::new());
+                err.span_suggestion_with_applicability(
+                    self.span,
+                    "remove this comma",
+                    String::new(),
+                    Applicability::MachineApplicable,
+                );
             }
         }
         err
@@ -6083,7 +6088,12 @@ impl<'a> Parser<'a> {
                                                                 self.this_token_to_string()));
                 if self.token.is_ident() {
                     // This is likely another field; emit the diagnostic and keep going
-                    err.span_suggestion(sp, "try adding a comma", ",".into());
+                    err.span_suggestion_with_applicability(
+                        sp,
+                        "try adding a comma",
+                        ",".into(),
+                        Applicability::MachineApplicable,
+                    );
                     err.emit();
                 } else {
                     return Err(err)