Skip to content

chore: fix current nightly lints - #578

Open
basnijholt wants to merge 1 commit into
matrix-construct:mainfrom
mindroom-ai:fix/nightly-lint-cleanup
Open

chore: fix current nightly lints#578
basnijholt wants to merge 1 commit into
matrix-construct:mainfrom
mindroom-ai:fix/nightly-lint-cleanup

Conversation

@basnijholt

@basnijholt basnijholt commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

While checking CI on #576 and #577, I reproduced the nightly formatting and Clippy failures on unmodified current main. They are shared baseline failures, so I'm keeping the cleanup in its own PR instead of adding it to either feature patch.

This sets wrap_comments = false in rustfmt.toml, so the new nightly formatter leaves the existing comment layout alone. The original comment reflow has been removed from the diff; there are now nine changed files.

The remaining source changes simplify five imports ending in ::{self} and remove six clones flagged by nightly Clippy. Each removed clone was at the value's final use. The clones still needed across state-resolution iterations and for the sending transaction status map remain in place. No toolchain pin or new lint allowances are added.

Verified locally on aarch64 Linux after this revision:

  • cargo fmt --all -- --check with the formatter from the pinned development shell, nightly-2026-09-05, and nightly-2026-09-06.
  • Clippy with -D warnings across all workspace targets and all features: Rust 1.95.0, nightly-2026-09-05, and nightly-2026-09-06. Both nightly runs use CI's test profile and existing solver/unstable-feature flags.
  • Rust 1.95.0 cargo test --offline --locked --workspace --all-targets --all-features: 1,078 passed, zero failed, four existing ignored tests; benchmark smoke checks passed too. Server tests used isolated local databases and loopback networking.
  • All original comment lines and the generated tuwunel-example.toml are unchanged from main.

I haven't run Complement locally; no protocol or compliance change is intended.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The ownership changes preserve behavior, the import simplifications are equivalent, and the remaining changes are formatting-only.

Pull request overview

Updates the codebase to pass current nightly rustfmt and Clippy checks without changing APIs or behavior.

Changes:

  • Simplifies five redundant ::{self} imports.
  • Removes six unnecessary clones by moving values into their final uses.
  • Applies nightly rustfmt comment reflow.
File summaries
File Description
src/service/users/register.rs Reflows comments.
src/service/users/mod.rs Reflows comments.
src/service/users/keys.rs Reflows comments.
src/service/uiaa/mod.rs Reflows comments.
src/service/tests/state_res/resolve.rs Reflows comments.
src/service/server_keys/verify.rs Reflows comments.
src/service/server_keys/keypair.rs Reflows comments.
src/service/sending/sender.rs Moves destination into final use and reflows comments.
src/service/sending/mod.rs Reflows comments.
src/service/rooms/timeline/create.rs Reflows comments.
src/service/rooms/timeline/build.rs Reflows comments.
src/service/rooms/timeline/backfill.rs Reflows comments.
src/service/rooms/timeline/append.rs Reflows comments.
src/service/rooms/threads/mod.rs Reflows comments.
src/service/rooms/state/prune.rs Reflows comments.
src/service/rooms/state_res/topological_sort.rs Reflows comments.
src/service/rooms/state_res/test_utils.rs Moves rebuilt event into its final store.
src/service/rooms/state_res/resolve/tests.rs Reflows comments.
src/service/rooms/state_res/resolve/split_conflicted.rs Moves owned keys and IDs instead of cloning.
src/service/rooms/state_res/resolve/iterative_auth_check.rs Reflows comments.
src/service/rooms/state_res/resolve.rs Reflows comments.
src/service/rooms/state_res/event_auth/tests/room_power_levels.rs Reflows comments.
src/service/rooms/state_res/event_auth/tests.rs Reflows comments.
src/service/rooms/state_res/event_auth/room_member/tests.rs Reflows comments.
src/service/rooms/state_res/event_auth/room_member.rs Reflows comments.
src/service/rooms/state_res/event_auth.rs Reflows comments.
src/service/rooms/state_cache/update.rs Reflows comments.
src/service/rooms/state_accessor/server_can.rs Reflows comments.
src/service/rooms/read_receipt/data.rs Reflows comments.
src/service/rooms/pdu_metadata/relations.rs Reflows comments.
src/service/rooms/event_handler/upgrade_outlier_pdu.rs Reflows comments.
src/service/rooms/event_handler/state_at_incoming.rs Reflows comments.
src/service/rooms/event_handler/outlier_state.rs Reflows comments.
src/service/rooms/event_handler/handle_outlier_pdu.rs Reflows comments.
src/service/rooms/event_handler/handle_incoming_pdu.rs Reflows comments.
src/service/rooms/alias/mod.rs Reflows comments.
src/service/resolver/tests.rs Reflows comments.
src/service/resolver/actual.rs Reflows comments.
src/service/presence/pipeline.rs Reflows comments.
src/service/presence/mod.rs Reflows comments.
src/service/presence/aggregate.rs Reflows comments.
src/service/migrations/retroactively_fix_bad_data_from_roomuserid_joined.rs Reflows comments.
src/service/migrations/mod.rs Reflows comments.
src/service/migrations/email_bindings.rs Reflows comments.
src/service/migrations/conduit.rs Reflows comments.
src/service/membership/stripped_state.rs Reflows comments.
src/service/membership/leave.rs Reflows comments.
src/service/membership/knock.rs Reflows comments.
src/service/membership/join.rs Reflows comments.
src/service/media/video.rs Reflows comments.
src/service/media/thumbnail.rs Reflows comments.
src/service/media/remote.rs Reflows comments.
src/service/media/mod.rs Reflows comments.
src/service/media/migrations.rs Simplifies standard-library imports.
src/service/fetcher/worker.rs Reflows comments.
src/service/fetcher/tests.rs Reflows comments.
src/service/fetcher/mod.rs Reflows comments.
src/service/emergency/mod.rs Reflows comments.
src/service/appservice/mod.rs Reflows comments.
src/service/admin/mod.rs Reflows comments.
src/service/admin/grant.rs Reflows comments.
src/service/admin/execute.rs Reflows comments.
src/router/serve/tls.rs Reflows comments.
src/router/serve.rs Reflows comments.
src/router/run.rs Reflows comments.
src/main/tests/uiaa_ldap_origin.rs Reflows comments.
src/main/tests/sync_left_foreign_state.rs Reflows comments.
src/main/tests/messages_pagination_bounds.rs Reflows comments.
src/main/tests/appservice_txn.rs Reflows comments.
src/main/tests/admin_backup_disabled.rs Reflows comments.
src/main/runtime.rs Reflows comments.
src/main/logging.rs Reflows comments.
src/main/health.rs Reflows comments.
src/main/args.rs Reflows comments.
src/macros/config.rs Reflows comments.
src/database/tests.rs Reflows comments.
src/database/stream.rs Reflows safety comments.
src/database/pool.rs Reflows comments.
src/database/map/watch.rs Reflows comments.
src/database/map/open.rs Reflows safety comments.
src/database/engine/db_opts.rs Reflows comments.
src/database/de.rs Reflows comments.
src/core/utils/unhandled.rs Reflows safety comments.
src/core/utils/sys/compute.rs Reflows safety comments.
src/core/utils/string/unquoted.rs Reflows safety comments.
src/core/utils/content_disposition.rs Reflows comments.
src/core/mods/new.rs Reflows safety comments.
src/core/mods/module.rs Reflows safety comments.
src/core/matrix/pdu/format/check.rs Reflows comments.
src/core/matrix/event/id.rs Reflows comments.
src/core/matrix/event/filter.rs Reflows comments.
src/core/config/tests.rs Reflows comments.
src/core/config/regenerate/write.rs Reflows safety comments.
src/core/config/regenerate/tests.rs Reflows comments.
src/core/config/manager.rs Reflows safety comments.
src/core/config/check.rs Reflows comments.
src/api/server/send_join.rs Reflows comments.
src/api/router/state.rs Reflows safety comments.
src/api/router/auth/uiaa.rs Reflows comments.
src/api/oidc/userinfo.rs Reflows comments.
src/api/oidc/token.rs Reflows comments.
src/api/oidc/registration.rs Reflows comments.
src/api/oidc/native.rs Reflows comments.
src/api/oidc/device/consent.rs Reflows comments.
src/api/oidc/complete.rs Reflows comments.
src/api/oidc/authorize.rs Reflows comments.
src/api/oidc/account/session_view.rs Reflows comments.
src/api/oidc/account/session_list.rs Reflows comments.
src/api/oidc/account.rs Reflows comments.
src/api/client/well_known.rs Simplifies discovery import.
src/api/client/user_directory.rs Simplifies user-directory import.
src/api/client/sync/v5/rooms.rs Reflows comments.
src/api/client/sync/v3.rs Reflows comments.
src/api/client/space.rs Reflows comments.
src/api/client/session/sso.rs Reflows comments.
src/api/client/session/mod.rs Reflows comments.
src/api/client/session/ldap.rs Reflows comments.
src/api/client/send.rs Simplifies utility imports.
src/api/client/room/upgrade.rs Reflows comments.
src/api/client/room/create.rs Reflows comments.
src/api/client/register/register.rs Reflows comments.
src/api/client/register/available.rs Reflows comments.
src/api/client/push/pushrules.rs Reflows comments.
src/api/client/push/pushrules_global.rs Reflows comments.
src/api/client/membership/members.rs Simplifies membership import.
src/api/client/membership/invite.rs Reflows comments.
src/api/client/media.rs Reflows comments.
src/api/client/keys/upload_signing_keys.rs Reflows comments.
src/api/client/keys/claim_keys.rs Reflows comments.
src/api/client/capabilities.rs Reflows comments.
src/api/client/alias/directory_room.rs Reflows comments.
src/api/client/admin/users/create_or_modify.rs Reflows comments.
src/api/client/admin/users/account_data.rs Reflows comments.
src/api/client/admin/rooms/list_rooms.rs Reflows comments.
src/api/client/admin/register.rs Reflows comments.
src/api/client/account/3pid/request_password_change_token_via_email.rs Reflows comments.
src/admin/room/list.rs Reflows comments.
Review details
  • Files reviewed: 137/137 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jevolk

jevolk commented Sep 6, 2026

Copy link
Copy Markdown
Member

Hi @basnijholt, it looks like rustfmt released some breaking changes a few hours ago. Since this is not a regression we're not going to pin an older nightly.

Instead of reformatting 137 files, try setting wrap_comments = false in the rustfmt.toml. This PR should then be reduced to your use statement changes with no other noise.

Sorry about our bleeding-edge lifestyle here, but it does have its merits.

@basnijholt
basnijholt force-pushed the fix/nightly-lint-cleanup branch from 09684b6 to 958a091 Compare September 6, 2026 20:04
@basnijholt

Copy link
Copy Markdown
Contributor Author

Set wrap_comments = false and restored the original comment layout. The diff is now nine files, with no comment reflow.

I kept the six redundant-clone fixes alongside the five import cleanups because those clones also cause fatal errors in the nightly Clippy jobs. The required clones are unchanged.

Rebuilt this as one commit and force-pushed. Fresh formatting checks pass with the pinned development formatter and both September 5 and September 6 nightlies; stable and nightly Clippy pass too. The isolated test run passed 1,078 tests, with four existing ignored tests.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants