Skip to content

Enable clippy::mem_replace_with_default#157336

Open
JarlEvanson wants to merge 2 commits into
rust-lang:mainfrom
JarlEvanson:mem-replace-with-default
Open

Enable clippy::mem_replace_with_default#157336
JarlEvanson wants to merge 2 commits into
rust-lang:mainfrom
JarlEvanson:mem-replace-with-default

Conversation

@JarlEvanson
Copy link
Copy Markdown
Contributor

Enables clippy::mem_replace_with_default and fixes the errors that occur as a result.

Closes #157245.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 2, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Jun 2, 2026

r? @mu001999

rustbot has assigned @mu001999.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: codegen, compiler, incremental, query-system
  • codegen, compiler, incremental, query-system expanded to 73 candidates
  • Random selection from 18 candidates

@JarlEvanson JarlEvanson changed the title Mem replace with default Enable clippy::mem_replace_with_default Jun 2, 2026
Copy link
Copy Markdown
Contributor

@JonathanBrouwer JonathanBrouwer left a comment

Choose a reason for hiding this comment

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

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 2, 2026

📌 Commit 3dacac8 has been approved by JonathanBrouwer

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 5. This pull request will be tested once the tree is reopened.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 2, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 2, 2026
…lt, r=JonathanBrouwer

Enable `clippy::mem_replace_with_default`

Enables `clippy::mem_replace_with_default` and fixes the errors that occur as a result.

Closes rust-lang#157245.
rust-bors Bot pushed a commit that referenced this pull request Jun 2, 2026
Rollup of 2 pull requests

Successful merges:

 - #157328 (windows: Elide division-by-zero checks in Instant::now())
 - #157336 (Enable `clippy::mem_replace_with_default`)
rust-bors Bot pushed a commit that referenced this pull request Jun 2, 2026
Rollup of 2 pull requests

Successful merges:

 - #157328 (windows: Elide division-by-zero checks in Instant::now())
 - #157336 (Enable `clippy::mem_replace_with_default`)
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 2, 2026
…hanBrouwer

Enable `clippy::mem_replace_with_default`

Enables `clippy::mem_replace_with_default` and fixes the errors that occur as a result.

Closes #157245.
@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 2, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 2, 2026

💔 Test for 153b697 failed: CI. Failed job:

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-aux failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[TIMING:end] compile::StdLink { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target_compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu, crates: [], force_recompile: false } -- 0.001
##[group]Building stage1 compiler artifacts (stage0 -> stage1, x86_64-unknown-linux-gnu)
error: process didn't exit successfully: `sccache /checkout/obj/build/bootstrap/debug/rustc -vV` (exit status: 2)
--- stderr
sccache: error: Timed out waiting for server startup. Maybe the remote service is unreachable?
Run with SCCACHE_LOG=debug SCCACHE_NO_DAEMON=1 to get more information

Bootstrap failed while executing `test --stage 2 src/tools/cargo src/tools/cargotest src/tools/test-float-parse`
Build completed unsuccessfully in 0:00:36
make: *** [Makefile:51: check-aux] Error 1
  local time: Tue Jun  2 23:51:55 UTC 2026
  network time: Tue, 02 Jun 2026 23:51:56 GMT
##[error]Process completed with exit code 2.
##[group]Run echo "disk usage:"
echo "disk usage:"

@jhpratt
Copy link
Copy Markdown
Member

jhpratt commented Jun 3, 2026

@bors retry

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 3, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 3, 2026
…lt, r=JonathanBrouwer

Enable `clippy::mem_replace_with_default`

Enables `clippy::mem_replace_with_default` and fixes the errors that occur as a result.

Closes rust-lang#157245.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use idiomatic std::mem::take instead of std::mem::replace

6 participants