-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Clippy vs. RUST_NEW_ERROR_FORMAT=true #907
Comments
(I took the liberty of fixing the link)
And I noticed in #906 that some spans used to be 0 bytes long, which used to be accepted apparently :( What version of Clippy is this? There is an error in a link with |
0.0.65, which was needed to run on the nightly that contains the new error formatting. Should I reopen my issue from last week? :) |
We probably should have a flag to hide the wiki links btw |
I think the ability to use MultiSpan was always there, btw, we just never used it. Also, does this break compiletest? |
|
IIRC |
Oh, I see. |
I see, that’s an actual bug. On it. |
At least that is not limited to Clippy. I just had error: missing field `line` in initializer of `doc::check_doc::Iter<_, _>` [--explain E0063]
--> src/doc.rs:145:16
145 |> let iter = Iter {
|> ^ with rustc itself. |
As for
this is also rustc: $ cat a.rs
trait Foo{}
fn main() {
&42 as Foo;
}
We are using rustc’s |
Yes, but we don’t really care. We also use |
By the way:
Niko writes that
Assuming this behaviour should stay this way, it may be an option to try to not use multi-line spans and use more additional 'help' spans. |
Seeing the great effort of improving rustc's error messages in rust-lang/rust#35233, I'm wondering if it'd make sense to do something similar for clippy as well – even if just to hop onto the "nicer errors" train and add some trivial explanations to some spans. (Stuff like annotating the NaN part in |
I think the new error format is pretty established now within both rustc and clippy, so I'll close this. |
Finally, there is a nightly that contains rust-lang/rust#32756! Clippy works mostly fine with it, but there are some minor issues. I posted an example output (PDF) on this internals.r-l.o thread, if you are interested in how this new style looks.
I noticed:
Some help messages contain line breaks with file names, e.g.,
Some warnings only underline one character in the line of code, e.g.
It is my understanding that the new format allows showing multiple annotations in the same code block, e.g. to show the highlighted spans (warning + note) in lints like "this
match
has identical arm bodies" (or "cannot borrow as mutable more than once at a time" as in the original example screenshot) next to each other. Clippy should do this!The text was updated successfully, but these errors were encountered: