]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/method/suggest.rs
Add help for static method invalid use
[rust.git] / src / librustc_typeck / check / method / suggest.rs
index 56eacc3194d1c8404c60d7c8e6dc073cc768af5c..11c043750357f5a6d1ba846a420480fa97e5c4b7 100644 (file)
@@ -260,6 +260,7 @@ macro_rules! report_function {
                 if !static_sources.is_empty() {
                     err.note("found the following associated functions; to be used as methods, \
                               functions must have a `self` parameter");
+                    err.help(&format!("try with `{}::{}`", self.ty_to_string(actual), item_name));
 
                     report_candidates(&mut err, static_sources);
                 }