From 815765dadeb011180ad3ea0ce02c9cc59f8c93cc Mon Sep 17 00:00:00 2001 From: Lamb Date: Wed, 30 May 2018 13:06:05 +0200 Subject: [PATCH] Issue #50974: Fix compilation error and test --- src/libsyntax/parse/parser.rs | 2 +- src/test/ui/struct-duplicate-comma.stderr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index d6916c1c344..456054ee251 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -776,7 +776,7 @@ impl<'a> Parser<'a> { err.span_label(self.span, format!("expected identifier, found {}", token_descr)); } else { err.span_label(self.span, "expected identifier"); - if self.token == token::Comma && self.look_ahead(1, |t| *t.is_ident()) { + if self.token == token::Comma && self.look_ahead(1, |t| t.is_ident()) { err.span_suggestion(self.span, "remove this comma", "".into()); } } diff --git a/src/test/ui/struct-duplicate-comma.stderr b/src/test/ui/struct-duplicate-comma.stderr index 37b573c2681..06e3b95c248 100644 --- a/src/test/ui/struct-duplicate-comma.stderr +++ b/src/test/ui/struct-duplicate-comma.stderr @@ -7,7 +7,7 @@ LL | a: 0,, | ^ | | | expected identifier - | help: remove this comma: `,` + | help: remove this comma error: aborting due to previous error