about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/structured_errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_hir_analysis/src/structured_errors.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/structured_errors.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_hir_analysis/src/structured_errors.rs b/compiler/rustc_hir_analysis/src/structured_errors.rs
index b061d637138..6846e4defe5 100644
--- a/compiler/rustc_hir_analysis/src/structured_errors.rs
+++ b/compiler/rustc_hir_analysis/src/structured_errors.rs
@@ -6,18 +6,18 @@ pub use self::{
     missing_cast_for_variadic_arg::*, sized_unsized_cast::*, wrong_number_of_generic_args::*,
 };
 
-use rustc_errors::DiagnosticBuilder;
+use rustc_errors::{DiagnosticBuilder, ErrCode};
 use rustc_session::Session;
 
 pub trait StructuredDiagnostic<'tcx> {
     fn session(&self) -> &Session;
 
-    fn code(&self) -> String;
+    fn code(&self) -> ErrCode;
 
     fn diagnostic(&self) -> DiagnosticBuilder<'tcx> {
         let err = self.diagnostic_common();
 
-        if self.session().teach(&self.code()) {
+        if self.session().teach(self.code()) {
             self.diagnostic_extended(err)
         } else {
             self.diagnostic_regular(err)