Skip to content

Replace deprecated fetch_update with try_update once MSRV is 1.95 #7108

Open

Description

@suzmue

Rust 1.99 deprecates Atomic*::fetch_update in favor of try_update ("renamed to try_update for consistency"). With --deny warnings, this is a hard error in our clippy CI.

try_update was stabilized in Rust 1.95.0, but we support all rust versions less than a year old so we can't switch yet. As part of the 1.99 toolchain bump, the affected call sites will keep fetch_update and add #[allow(deprecated)] plus a TODO linking this issue:

  • src/pubsub/src/publisher/token_bucket.rs: TokenBucket::try_acquire, TokenBucket::refill
  • src/spanner/src/channel_pool/entry.rs: ChannelEntry::apply_error_penalty
  • src/spanner/src/routing/server_connection.rs: ActiveRequestGuard::drop, ServerConnection::decrement_active_requests (test-only)

Once the MSRV is bumped to 1.95 or later:

  1. Replace each fetch_update call above with try_update (same arguments and semantics).
  2. Remove the matching #[allow(deprecated)] attributes and TODO comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: cleanupAn internal cleanup or hygiene concern.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions