-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hint when using a static method on an instance is wrong #29121
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
Comments
We should probably structure this so that both suggestions are shown. Alternatively, suggest changing the method only when the method is defined in the local crate. |
Current compiler message is slightly different:
The snippet given for the "candidate #1" seems wrong, shouldn't it present the definition of |
birkenfeld
added a commit
to birkenfeld/rust
that referenced
this issue
May 3, 2016
…back In case we cannot produce a span for the location of the definition, just do not show a span at all. cc: rust-lang#29121
bors
added a commit
that referenced
this issue
May 3, 2016
typeck: when suggesting associated fns, do not show call site as fallback In case we cannot produce a span for the location of the definition, just do not show a span at all. cc: #29121
Fixed by #33330. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wrote
Box::new(telemetry_t::new()).into_raw()
and got this output:The hint in particular was confusing, since it is targeted at developers who created the impl and forgot to provide a
self
argument, rather than consumers of an impl that is specifically designed to be static.The text was updated successfully, but these errors were encountered: