-
Notifications
You must be signed in to change notification settings - Fork 95
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
Avoid new lints in 1.81.0 #337
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Techcable
force-pushed
the
fixes/avoid-1.81.0-lints
branch
from
September 23, 2024 15:37
3cd4f8c
to
832aea2
Compare
Techcable
force-pushed
the
fixes/avoid-1.81.0-lints
branch
5 times, most recently
from
September 23, 2024 17:04
4b8bf0a
to
6ce87a1
Compare
This comment was marked as outdated.
This comment was marked as outdated.
1 task
Techcable
force-pushed
the
fixes/avoid-1.81.0-lints
branch
from
September 23, 2024 17:15
6ce87a1
to
e5629ae
Compare
Split the clippy CI changes into PR #339 |
This is used for clippy lints.
Config names are now validated at compile time: https://blog.rust-lang.org/2024/05/06/check-cfg.html
This avoids the following warning: ``` warning: `/Users/nicholas/git/slog.org/slog/.cargo/config` is deprecated in favor of `config.toml` note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml` ``` Since our MSRV is currently 1.49, we can safely make this change without needing a system link.
Avoids a cargo warning
These declarations are not needed. This avoids the #[deny(unused_extern_crates)] lint, implied by #[deny(rust_2018_idioms)] This error only occurs when the `nested-values` feature is enabled. This error also seems to only occur on new versions (ex. 1.72 is fine). Switch #[deny(rust_2018_idioms)] to #[warn(...)] to avoid unnecessary build failures in the future.
Instead of doing this: ``` #[cfg(not(feature = "std"))] use alloc::borrow::Cow; #[cfg(feature = "std")] use std::borrow::Cow; ``` Just unconditionally import from alloc: ``` use alloc::borrow::Cow; ``` Enable #[warn(clippy::std_instead_of_alloc, clippy::std_instead_of_core)] to warn about these imports in the future. Conditionally declare #[no_std] if and only if not(cfg(feature = "std")) This is cleaner and avoids an `extern crate std` declaration, but semantically there should be no difference.
This is a mistake in markdown syntax, caught by a clippy lint: https://rust-lang.github.io/rust-clippy/rust-1.81.0/index.html#/doc_lazy_continuation
Techcable
force-pushed
the
fixes/avoid-1.81.0-lints
branch
from
September 23, 2024 17:22
e5629ae
to
4e24c23
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Avoid new lints:
check-cfg
lint in 1.81.0./cargo/config
to.cargo/config.toml
extern crate
declarations, avoiding#[deny(unused_extern_crates)]
lint.#[deny(rust_2018_idioms)]
to#[warn(...)]
to avoid unnecessary build failures in the future.#[no_std]
if and only if #[cfg(not(feature = "std)], avoiding anextern crate std
declaration.This expresses the intent clearer.
#[warn(clippy::doc_lazy_continuation)]
Make sure to: