-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Erroneous self arguments on bare functions emit subpar compilation error #55972
Comments
rust/src/libsyntax/parse/parser.rs Line 5386 in 9649c1f
should have a call on the first argument to rust/src/libsyntax/parse/parser.rs Line 5463 in 9649c1f
which if the result is You can look at rust/src/libsyntax/parse/parser.rs Line 5567 in 9649c1f
to see how trait You can see how a diagnostic is created here rust/src/libsyntax/parse/parser.rs Lines 803 to 821 in 9649c1f
and after that all that is needed for that error to be outputted is to call https://forge.rust-lang.org has information on the compiler itself, you'll want to at the very least look at https://forge.rust-lang.org/x-py.html. |
Hello, I would like to work on this |
As this is also causing the same error message, I think that it might actually be better to check for
|
That is a good point. It's probably a good idea to have different error message for the (so far) three cases. On |
Ok 👍 will do |
fix rust-lang#55972: Erroneous self arguments on bare functions emit subpar compilation error rust-lang#55972 r? @estebank
Rollup of 11 pull requests Successful merges: - #55367 (lint if a private item has doctests) - #55485 (Return &T / &mut T in ManuallyDrop Deref(Mut) impl) - #55784 (Clarifying documentation for collections::hash_map::Entry::or_insert) - #55961 (Fix VecDeque pretty-printer) - #55980 (Suggest on closure args count mismatching with pipe span) - #56002 (fix #55972: Erroneous self arguments on bare functions emit subpar compilation error) - #56063 (Update any.rs documentation using keyword dyn) - #56067 (Add SGX target to rustc) - #56078 (Fix error message for `-C panic=xxx`.) - #56106 (Remove some incorrect doc comments) - #56126 (core/benches/num: Add `from_str/from_str_radix()` benchmarks) Failed merges: r? @ghost
When refactoring methods as bare functions and forgetting to remove the self argument, the compiler fails to parse the new function entirely instead of emitting a better error.
The text was updated successfully, but these errors were encountered: