-
Notifications
You must be signed in to change notification settings - Fork 33
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 new nightly Clippy warnings #135
Conversation
- Suppress warning from the cfg(loom) directive by having it emit "rustc-check-cfg" in build.rs - Remove usage of legacy "std::usize" module. - Ignore "clippy::multiple_bound_locations". We use multiple bounds as a workaround for an issue in pin-project-lite where only one bound can be assigned per location. The phrasing of pin-project-lite's README implies that this issue is WONTFIX. To quote: > This library does not tackle as expansive of a range of use cases as > pin-project does. If your use case is not already covered, please use > pin-project. Signed-off-by: John Nunley <[email protected]>
MIRI failure is tracked in #133 |
//! Without this, the compiler complains about the unspecified "loom" flag. | ||
|
||
fn main() { | ||
println!("cargo:rustc-check-cfg=cfg(loom)"); |
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.
I would like to use rust-lang/cargo#13913 's config option instead of adding build script.
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.
Tracked in #136
@@ -68,6 +68,7 @@ | |||
//! [`portable-atomic`]: https://crates.io/crates/portable-atomic | |||
|
|||
#![cfg_attr(not(feature = "std"), no_std)] | |||
#![allow(clippy::multiple_bound_locations)] // This is a WONTFIX issue with pin-project-lite |
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.
If this lint is triggered for code generated by external macros, it is definitely clippy bug.
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, I found rust-lang/rust-clippy#12552.
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.
Oh, looking at your PR description, this lint may also need to be allowed on the pin-project-lite side, but it's not clear which one is actually causing a warning here.
#135 (comment) Signed-off-by: John Nunley <[email protected]>
#135 (comment) Signed-off-by: John Nunley <[email protected]>
#135 (comment) Signed-off-by: John Nunley <[email protected]>
"rustc-check-cfg" in build.rs
workaround for an issue in pin-project-lite where only one bound can be
assigned per location. The phrasing of pin-project-lite's README implies that
this issue is WONTFIX. To quote: