about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorJoseph Post <joe@jcpst.com>2018-08-25 22:47:46 -0500
committerJoseph Post <joe@jcpst.com>2018-08-25 23:28:26 -0500
commit1f421d645633f600e85ecec60a56ac5b4c19335c (patch)
tree84444dbd7b12ff932f9614fb42c01be9d27bd1c2 /src/libsyntax/parse
parentd95f078f0af28203c379365574a433ca5b79e9d8 (diff)
downloadrust-1f421d645633f600e85ecec60a56ac5b4c19335c.tar.gz
rust-1f421d645633f600e85ecec60a56ac5b4c19335c.zip
call span_suggestion with applicability
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 725360b842d..a9bb013698e 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
@@ -6077,7 +6082,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)