about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2018-08-10 01:49:45 +0100
committervarkor <github@varkor.com>2018-08-11 21:08:24 +0100
commit49e9c5fe90db9a70697da8a3bf4237492376c541 (patch)
tree22ed9e0cb8cfa964f2b89dc62203cff8bfd66a24 /src/libsyntax/parse
parente4c3b49fe790dd23f32acace8157d897d31c0cb3 (diff)
downloadrust-49e9c5fe90db9a70697da8a3bf4237492376c541.tar.gz
rust-49e9c5fe90db9a70697da8a3bf4237492376c541.zip
Add E0642 to parser error
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 9a49d705c46..14026c5bede 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -44,7 +44,7 @@ use ast::{RangeEnd, RangeSyntax};
 use {ast, attr};
 use codemap::{self, CodeMap, Spanned, respan};
 use syntax_pos::{self, Span, MultiSpan, BytePos, FileName, edition::Edition};
-use errors::{self, Applicability, DiagnosticBuilder};
+use errors::{self, Applicability, DiagnosticBuilder, DiagnosticId};
 use parse::{self, SeqSep, classify, token};
 use parse::lexer::TokenAndSpan;
 use parse::lexer::comments::{doc_comment_style, strip_doc_comment_decoration};
@@ -1775,8 +1775,11 @@ impl<'a> Parser<'a> {
 
             match pat_arg {
                 Ok((pat, ty)) => {
-                    let mut err = self.diagnostic()
-                        .struct_span_err(pat.span, "patterns aren't allowed in trait methods");
+                    let mut err = self.diagnostic().struct_span_err_with_code(
+                        pat.span,
+                        "patterns aren't allowed in trait methods",
+                        DiagnosticId::Error("E0642".into()),
+                    );
                     err.span_suggestion_short_with_applicability(
                         pat.span,
                         "give this argument a name or use an underscore to ignore it",