-
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
unnecessary_cast false positives in macros #3981
Comments
Hi, I would like to try to solve this, but I am very new to Rust, is that ok ? |
I see the same errors as you in the playground, but I cannot reproduce it in my own machine.
... copy paste your code in src/lib.rs and save
results in
|
Can you reproduce with |
Here is what I got (--verbose)
Still not getting these errors, are you? |
Oh, what version of clippy do you have? ( $ rustup update nightly
($ rustup component add clippy --toolchain=nightly) # only necessary if you haven't installed Clippy in nightly before
$ cargo +nightly clippy |
Ok with nightly I am seeing these errors now. How would you suggest getting started on this ? Is there a way to use a debugger when running clippy from a build of the project ? (I am using VSCode) In any case I'm not sure how to check my work. Thanks :) |
You can use the example code Line 46 in 9897442
After that you can test it with $ TESTNAME=ui/cast cargo +master uitest (You can install the master toolchain with RTIM or you can try if the nightly toolchain works by swapping To fix this issue you need to add a macro check with the After that the above command should run without errors. (Maybe some lines in the *.stderr file need to be adapted) Also have a look at https://github.com/rust-lang/rust-clippy/blob/master/doc/adding_lints.md. It's a really good documentation on how to work on Clippy. |
Playground:
produces
The text was updated successfully, but these errors were encountered: