Repository navigation
fix: avoid double_must_use in macro-generated code - #17547
Conversation
|
Thanks for the pull request. A reviewer will take a look after it receives 2 community reviews. In the meantime, we would highly appreciate if you could try to review any of PRs waiting on community reviews. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
|
Reminder, once the PR becomes ready for a review, use |
|
@rustbot ready |
|
@blyxyas should I correct the CI issue that stopped the merge ? |
It was a spurious network issue. We'll re-try |
|
@rustbot label +beta-nominated |
|
@cschramm what's the reason for the beta nomination? Are you encountering a specially-awful occurrence of this bug? |
|
It depends on what you consider especially awful, but for any code base with reasonable usage of e.g. |
|
@rustbot label -beta-nominated Disregard. |
## Why CI selected the floating `stable` channel. When stable moved from 1.98.1 to 1.99.0, `cargo clippy ... -D warnings` started failing on unchanged `main` with `clippy::double_must_use` on the `#[async_trait]` expansion of `ExecutionOwnership` (`src-tauri/src/lifecycle.rs`). That is a Clippy false positive on macro-generated code (rust-lang/rust-clippy#17529), fixed by rust-lang/rust-clippy#17547 and present in 1.100 beta/nightly, but not in any stable release yet. ## What - Add `rust-toolchain.toml` (channel `1.98.1`, profile `minimal`) as the only place the Rust version is declared. rustup applies it to every `cargo`/`rustc` run in a checkout: local, agent workspaces, CI and release. - Replace the five `dtolnay/rust-toolchain` uses in `ci.yml` and `release.yml` with `rustup toolchain install --no-self-update`, run after checkout so the file is honored. No version literal in the workflows. - Components and targets stay job-specific: `clippy` in the lint job, `wasm32-unknown-unknown` where `trunk build` runs, the macOS release targets on macOS only. - Docs: Rust is pinned by `rust-toolchain.toml`; developers add `clippy`/`rustfmt` themselves. ## Behavior of the removed action - `CARGO_INCREMENTAL=0`: still set by `Swatinem/rust-cache` in every job that uses it; release builds are not incremental. - `rustup default`, `CARGO_HOME`, rustup bootstrap, sparse-registry and curl workarounds: unnecessary on current runners (rustup 1.29.x preinstalled on ubuntu-22.04, Windows 2025 and macOS 26). - `CARGO_TERM_COLOR=always`: cosmetic only, dropped. ## Not in this PR No `rust-version` in `Cargo.toml` (this is a toolchain pin, not an MSRV), no `#[allow(clippy::double_must_use)]`, no move to 1.99. A later bump should target the first stable release containing the Clippy fix and address its new warnings (1.100 beta reports four unused-dependency warnings). ## Validation With Rust 1.98.1 selected only by the file: the exact CI Clippy command, the acceptance-harness Clippy command and the CI test commands pass. Rust 1.99.0 fails the Clippy command on unchanged `main`; 1.98.1 passes.
Fixes #17529
double_must_useandmust_use_unitnow ignore#[must_use]attributes generated by macro expansion, while continuing to lint user-written attributes passed through procedural macros.changelog: [
double_must_use]: Fixed false positives from macro-generated#[must_use]attributes.