Skip to content

Conversation

ada4a
Copy link
Contributor

@ada4a ada4a commented Oct 4, 2025

I'm working on an enhancement to clippy::format_push_string, which would suggest an autofix to replace push_str/+= with write!. But that could require importing std::fmt::Write, and so I need this diagnostic item to check if it's already in scope.

The reason I called it FmtWrite and not just Write is that there's already an IoWrite defined.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 4, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 4, 2025

r? @fmease

rustbot has assigned @fmease.
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

@fmease
Copy link
Member

fmease commented Oct 4, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 4, 2025

📌 Commit 2688f60 has been approved by fmease

It is now in the queue for this repository.

@bors bors 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 Oct 4, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 4, 2025
Make `fmt::Write` a diagnostic item

I'm working on an enhancement to [`clippy::format_push_string`](https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string), which would suggest an autofix to replace `push_str`/`+=` with `write!`. But that could require importing `std::fmt::Write`, and so I need this diagnostic item to check if it's already in scope.

The reason I called it `FmtWrite` and not just `Write` is that there's already an `IoWrite` defined.
bors added a commit that referenced this pull request Oct 5, 2025
Rollup of 6 pull requests

Successful merges:

 - #143900 ([rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition)
 - #144908 (Fix doctest output json)
 - #147309 (Add documentation about unwinding to wasm targets)
 - #147328 (Implement non-poisoning `Mutex::with_mut`, `RwLock::with` and `RwLock::with_mut`)
 - #147337 (Make `fmt::Write` a diagnostic item)
 - #147349 (Improve the advice given by panic_immediate_abort)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Oct 5, 2025
Make `fmt::Write` a diagnostic item

I'm working on an enhancement to [`clippy::format_push_string`](https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string), which would suggest an autofix to replace `push_str`/`+=` with `write!`. But that could require importing `std::fmt::Write`, and so I need this diagnostic item to check if it's already in scope.

The reason I called it `FmtWrite` and not just `Write` is that there's already an `IoWrite` defined.
Zalathar added a commit to Zalathar/rust that referenced this pull request Oct 5, 2025
Make `fmt::Write` a diagnostic item

I'm working on an enhancement to [`clippy::format_push_string`](https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string), which would suggest an autofix to replace `push_str`/`+=` with `write!`. But that could require importing `std::fmt::Write`, and so I need this diagnostic item to check if it's already in scope.

The reason I called it `FmtWrite` and not just `Write` is that there's already an `IoWrite` defined.
bors added a commit that referenced this pull request Oct 5, 2025
Rollup of 8 pull requests

Successful merges:

 - #143900 ([rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition)
 - #147288 (compiletest: Make `DirectiveLine` responsible for name/value splitting)
 - #147309 (Add documentation about unwinding to wasm targets)
 - #147310 (Mark `PatternTypo` suggestion as maybe incorrect)
 - #147320 (Avoid to suggest pattern match on the similarly named in fn signature)
 - #147328 (Implement non-poisoning `Mutex::with_mut`, `RwLock::with` and `RwLock::with_mut`)
 - #147337 (Make `fmt::Write` a diagnostic item)
 - #147349 (Improve the advice given by panic_immediate_abort)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Oct 5, 2025
Rollup of 7 pull requests

Successful merges:

 - #147288 (compiletest: Make `DirectiveLine` responsible for name/value splitting)
 - #147309 (Add documentation about unwinding to wasm targets)
 - #147310 (Mark `PatternTypo` suggestion as maybe incorrect)
 - #147320 (Avoid to suggest pattern match on the similarly named in fn signature)
 - #147328 (Implement non-poisoning `Mutex::with_mut`, `RwLock::with` and `RwLock::with_mut`)
 - #147337 (Make `fmt::Write` a diagnostic item)
 - #147349 (Improve the advice given by panic_immediate_abort)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 8075935 into rust-lang:master Oct 5, 2025
10 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 5, 2025
rust-timer added a commit that referenced this pull request Oct 5, 2025
Rollup merge of #147337 - ada4a:write-diag-item, r=fmease

Make `fmt::Write` a diagnostic item

I'm working on an enhancement to [`clippy::format_push_string`](https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string), which would suggest an autofix to replace `push_str`/`+=` with `write!`. But that could require importing `std::fmt::Write`, and so I need this diagnostic item to check if it's already in scope.

The reason I called it `FmtWrite` and not just `Write` is that there's already an `IoWrite` defined.
@ada4a ada4a deleted the write-diag-item branch October 5, 2025 09:55
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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants