-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fix some warnings #680
Fix some warnings #680
Conversation
@remilauzier What tool+version is giving you these warnings? |
It's rust_2018_idioms with rust stable. Hidden anonymous lifetime are deprecated and will be removed in the 2021 version. The remove u32 is IntelliJ IDEA. Using std:u32 are deprecated too. Using directly u32 is the new way. |
Ok! In our Makefile we have a variable |
@remilauzier I noticed that you edited |
It's been a few year that rustc and clippy read directly deny warning from the source file. That permit everyone to know what to do or not easily. It's really make to not depend on a single IDE. You can even put a |
@remilauzier This project has been around since before the "?" operator existed and when clippy could only be run on nightly! But, on reading around a bit, it looks like there are benefits to keeping these directives in a Makefile. Here's one pretty good reason: https://www.reddit.com/r/rust/comments/f5xpib/psa_denywarnings_is_actively_harmful/. And another: rust-lang/cargo#5998. We already use a clippy.toml to set the msrv....that seems to have come in handy. But we'll stick with setting those clippy and compiler warning directives in the Makefile, for the foreseeable future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thx for you answer. After some thought, I've decided to go w/ my original review. At some point, though, I'll probably try to move the two remaining directives in lib.rs
into the Makefile as well.
src/lib.rs
Outdated
@@ -62,6 +62,14 @@ | |||
//! 6. Optionally loop and re-invoke `poll()` on the fd to wait for more | |||
//! events. | |||
|
|||
#![deny( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please drop this edit and put any additional compiler restrictions you can add in the Makefile. We use a DENY
variable globally in all the targets, essentially. If you can augment that in any way, carry on. Also, since it looks like you can make this pass all the rust-2018-idioms lints, you can just delete the RUST_2018_IDIOMS
variable entirely and put -D rust-2018-idioms
in the value of the DENY
variable.
You'll notice that the two directives we have in lib.rs
are very non-technical and not related to Rust itself. They went in very early to both encourage documentation of methods and to make it easy to write meaningful comments w/out having to worry about formatting.
No description provided.