]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/method/suggest.rs
Add missing error code for private method
[rust.git] / src / librustc_typeck / check / method / suggest.rs
index c480febdec66f5c35be501f629ea8e409d4e7454..53da9e19ee0cdff01d7a698433242e2b80015a35 100644 (file)
@@ -312,8 +312,8 @@ macro_rules! report_function {
             }
 
             MethodError::PrivateMatch(def) => {
-                let msg = format!("{} `{}` is private", def.kind_name(), item_name);
-                self.tcx.sess.span_err(span, &msg);
+                struct_span_err!(self.tcx.sess, span, E0624,
+                                 "{} `{}` is private", def.kind_name(), item_name).emit();
             }
 
             MethodError::IllegalSizedBound(candidates) => {