Skip to content

Commit 3e6ad31

Browse files
authored
Unrolled build for #147337
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.
2 parents 227ac7c + 2688f60 commit 3e6ad31

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

compiler/rustc_span/src/symbol.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ symbols! {
236236
File,
237237
FileType,
238238
FmtArgumentsNew,
239+
FmtWrite,
239240
Fn,
240241
FnMut,
241242
FnOnce,

library/core/src/fmt/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ pub struct Error;
115115
/// [`std::io::Write`]: ../../std/io/trait.Write.html
116116
/// [flushable]: ../../std/io/trait.Write.html#tymethod.flush
117117
#[stable(feature = "rust1", since = "1.0.0")]
118+
#[rustc_diagnostic_item = "FmtWrite"]
118119
pub trait Write {
119120
/// Writes a string slice into this writer, returning whether the write
120121
/// succeeded.

0 commit comments

Comments
 (0)