Replace #[allow(lint)]
with #[expect(lint)]
#1820
Merged
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.
#[expect(lint)]
has been stabilized for a while. We should use it instead of#[allow(lint)]
whenever possible. RFL's coding guidelines explains why:In this PR, I have removed all obsolete
#[allow(lint)]
and replaced the remaining#[allow(lint)]
with#[expect(lint)]
.I'm also trying to globally enable the
allow_attributes
lint to prevent#[allow(lint)]
from being added inadvertently in the future. I'm trying to figure out what is the best way for us to globally enable lint1.First, I enabled the lint in the workspace:
Then every crate in the workspace could be made to respect the lint configuration:
However, I could not get such settings to be automatically added to crates outside the workspace (i.e., OSDK and those under
kernel/libs/comp-sys
). I left such crates as they were:asterinas/Cargo.toml
Lines 37 to 47 in 56b85cb
Footnotes
This is useful for us because it can help us deal with other lints in the future. For example, Rust 2024 is coming, so we may try to globally enable the rust-2024-compatibility lint group soon. ↩