]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/parse/parser.rs
Add E0642 to parser error
[rust.git] / src / libsyntax / parse / parser.rs
index 9a49d705c464b99ceda35bcb521cd162386f3583..14026c5bede68796d0aa5cd3cbf0c59696b0f489 100644 (file)
@@ -44,7 +44,7 @@
 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 @@ fn parse_arg_general(&mut self, require_name: bool) -> PResult<'a, Arg> {
 
             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",