From 1f421d645633f600e85ecec60a56ac5b4c19335c Mon Sep 17 00:00:00 2001 From: Joseph Post Date: Sat, 25 Aug 2018 22:47:46 -0500 Subject: call span_suggestion with applicability --- src/libsyntax/parse/parser.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/libsyntax/parse/parser.rs') 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) -- cgit 1.4.1-3-g733a5