Skip to content
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

Merged
merged 1 commit into from
May 19, 2024
Merged

Fix new nightly Clippy warnings #135

merged 1 commit into from
May 19, 2024

Conversation

notgull
Copy link
Member

@notgull notgull commented May 19, 2024

  • 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.

- 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]>
@notgull
Copy link
Member Author

notgull commented May 19, 2024

MIRI failure is tracked in #133

@notgull notgull merged commit eb54e95 into master May 19, 2024
9 of 10 checks passed
@notgull notgull deleted the notgull/clippy branch May 19, 2024 18:18
//! Without this, the compiler complains about the unspecified "loom" flag.

fn main() {
println!("cargo:rustc-check-cfg=cfg(loom)");
Copy link
Collaborator

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.

Copy link
Member Author

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
Copy link
Collaborator

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

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.

notgull added a commit that referenced this pull request May 19, 2024
notgull added a commit that referenced this pull request May 20, 2024
notgull added a commit that referenced this pull request May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants