alexcrichton opened PR #9696 from alexcrichton:expect-lints
to bytecodealliance:main
:
In Rust 1.81, our new MSRV, a new feature was added to Rust to use
#[expect]
to control lint levels. This new lint annotation will silence a lint but will itself cause a lint if it doesn't actually silence anything. This is quite useful to ensure that annotations don't get stale over time.Another feature is the ability to use a
reason
directive on the attribute with a string explaining why the attribute is there. This string is then rendered in compiler messages if a warning or error happens.This commit migrates applies a few changes across the workspace:
- Some
#[allow]
are changed to#[expect]
with areason
.- Some
#[allow]
have areason
added if the lint conditionally fires (mostly related to macros).- Some
#[allow]
are removed since the lint doesn't actually fire.- The workspace configures
clippy::allow_attributes_without_reason = 'warn'
as a "ratchet" to prevent future regressions.- Many crates are annotated to allow
allow_attributes_without_reason
during this transitionary period.The end-state is that all crates should use
#[expect(..., reason = "...")]
for any lint that unconditionally fires but is expected. The#[allow(..., reason = "...")]
lint should be used for conditionally firing lints, primarily in macro-related code. Theallow_attributes_without_reason = 'warn'
level is intended to be permanent but the transitionary
#[expect(clippy::allow_attributes_without_reason)]
crate annotations to go away over time.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton has marked PR #9696 as ready for review.
alexcrichton requested wasmtime-fuzz-reviewers for a review on PR #9696.
alexcrichton requested cfallin for a review on PR #9696.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #9696.
alexcrichton requested wasmtime-core-reviewers for a review on PR #9696.
alexcrichton requested pchickey for a review on PR #9696.
alexcrichton requested wasmtime-default-reviewers for a review on PR #9696.
github-actions[bot] commented on PR #9696:
Subscribe to Label Action
cc @cfallin, @fitzgen
<details>
This issue or pull request has been labeled: "cranelift", "cranelift:meta", "cranelift:module", "isle", "wasmtime:c-api"Thus the following users have been cc'd because of the following labels:
- cfallin: isle
- fitzgen: isle
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
alexcrichton updated PR #9696.
alexcrichton updated PR #9696.
alexcrichton updated PR #9696.
pchickey submitted PR review.
alexcrichton merged PR #9696.
Last updated: Dec 23 2024 at 12:05 UTC