From 1d29966d3bf89a6b05f49005551def3b32987155 Mon Sep 17 00:00:00 2001 From: Michael Hewson Date: Tue, 7 Nov 2017 14:32:59 -0500 Subject: [PATCH] wrap error code in DiagnosticId::Error so it compiles --- src/librustc_typeck/check/wfcheck.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index a75f35be1f3..89dbd20b699 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -22,7 +22,7 @@ use rustc::middle::lang_items; use syntax::ast; use syntax::feature_gate::{self, GateIssue}; use syntax_pos::Span; -use errors::DiagnosticBuilder; +use errors::{DiagnosticBuilder, DiagnosticId}; use rustc::hir::intravisit::{self, Visitor, NestedVisitorMap}; use rustc::hir; @@ -489,7 +489,7 @@ impl<'a, 'gcx> CheckTypeWellFormedVisitor<'a, 'gcx> { fcx.tcx.sess.diagnostic().mut_span_err(span, &format!("invalid `self` type: {:?}", self_arg_ty)) .note(&format!("type must be `{:?}` or a type that dereferences to it`", self_ty)) .help("consider changing to `self`, `&self`, `&mut self`, or `self: Box`") - .code("E0307".into()) + .code(DiagnosticId::Error("E0307".into())) .emit(); break }