Skip to content

infra: Cargo.toml leaves clippy::await_holding_lock / await_holding_refcell_ref / await_holding_invalid_type unset (RUST-019) #2715

Closed

Description

@zackees

ci-lint precheck reports three findings on Cargo.toml that no exception covers:

== RUST-019 (3) ==
[RUST-019] VIOLATION Cargo.toml
    what:  clippy::await_holding_lock is unset in `[workspace.lints.clippy]`
    what:  clippy::await_holding_refcell_ref is unset in `[workspace.lints.clippy]`
    what:  clippy::await_holding_invalid_type is unset in `[workspace.lints.clippy]`

Header on master at the time of filing:

ci-lint precheck: 24 violation(s), 488 approved exception(s), 31 needs_review

Why it matters

The three lints are the only guard against a Mutex/RefCell guard living across an
.await: the future is then !Send (or the runtime deadlocks when the executor polls the
same task on one thread), and the failure is a runtime hang, not a diagnosable error. They
are pedantic lints, so they never fire unless the workspace opts in, and
[workspace.lints.clippy] currently opts in to only wildcard_imports and
enum_glob_use.

The workspace has no async code today — git grep '\.await' -- rust ':!rust/tools' matches
only rust/obs-util/tests/platform/nix_inhibit.rs, and those matches are the helper
await_parked(…), not the .await operator — so the lints are inert right now. That is
exactly the moment to turn them on: the first async caller in rust/* then cannot land a
guard-across-await, rather than the rule being added after the bug exists.

Scope

  • Cargo.toml: add await_holding_lock = "deny", await_holding_refcell_ref = "deny",
    await_holding_invalid_type = "deny" to [workspace.lints.clippy].
  • Every member already inherits the table (rust/*/Cargo.toml each carry
    [lints] workspace = true), so no member file changes.
  • No clippy.toml entry is needed: the rule registers a project's own blocking wrapper
    types only; the std guard types are covered by the two built-in lints. The workspace has
    no wrapper type of its own.

Verification

  • RED: ci-lint precheck on origin/master lists the three RUST-019 violations above.
  • GREEN: the same command on the branch reports zero RUST-019 findings and the header drops
    to 21 violations; the Rust lint lane (soldr cargo clippy …) stays green, since no
    guard-across-await exists.

This is a CI/lint configuration change, so it carries no user-visible behaviour and needs no
docs/features.md line.

Activity

  1. added
    infra
    on Oct 28, 2026
  2. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    Claiming: investigation

    Scope is already confirmed from the tree, so this is a one-PR unit:

    1. Add the three await_holding_* lints to [workspace.lints.clippy] in Cargo.toml (every member already carries [lints] workspace = true).
    2. RED: ci-lint precheck on origin/master lists the three RUST-019 violations; GREEN: zero after the edit, header 24 -> 21, with the Rust lint lane still green (no guard-across-await exists in rust/*).
    3. No clippy.toml wrapper registration is needed — the workspace has no blocking wrapper type of its own.

    Expect the first PR within this slot.

  3. added
    needs-investigation
    on Oct 28, 2026
  4. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    /ready

  5. added
    ready
    and removed
    needs-investigation
    on Oct 28, 2026
  6. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    Claiming: RUST-019 workspace await-holding lints

    Plan as above: one Cargo.toml edit, RED = precheck's three RUST-019 findings on master, GREEN = the same command with none and the header 24 -> 21.

  7. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    Fixed by #2716 (merged as 79d34d211).

    • Cargo.toml's [workspace.lints.clippy] now denies await_holding_lock, await_holding_refcell_ref and await_holding_invalid_type, with no member change (every crate already carries [lints] workspace = true) and no clippy.toml wrapper registration.
    • Verified on merged master: ci-lint precheck now reports 21 violation(s), 488 approved exception(s), 31 needs_review (was 24) and has no RUST-019 section.
    • Local evidence on the branch: soldr cargo clippy --locked --workspace --all-targets -- -D warnings clean (46 s), ./lint lane ok (160 s), ./unittest ok (rust-test 548 s, tier2-linux 2308 s, exit 0).

    Nothing left on this unit — no follow-up issue. The remaining 21 violations are the structural floor (CACHE-001/GEN-002/WF-003/SEC-003/GEN-004/CACHE-004) plus the newer CACHE-037 (appimage.yaml cargo cache paths/key), CACHE-038 (shared cache-key-suffix on one runner), GEN-022 (ci-gate needs cancel-superseded), GEN-026 (leaderboard.yml pinned ref) and REL-007 (ci-mode reachable from a release), each of which is a separate unit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

infraready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions