bors 68b44986de Auto merge of #8365 - Alexendoo:explicit-write-suggestion, r=camsteffen
Add `explicit_write` suggestions for `write!`s with format args

changelog: Add [`explicit_write`] suggestions for `write!`s with format args

Fixes #4542

```rust
writeln!(std::io::stderr(), "macro arg {}", one!()).unwrap();
```

Now suggests:

```
error: use of `writeln!(stderr(), ...).unwrap()`
  --> $DIR/explicit_write.rs:36:9
   |
LL |         writeln!(std::io::stderr(), "macro arg {}", one!()).unwrap();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `eprintln!("macro arg {}", one!())`
```

---------

r? `@camsteffen` (again, sorry 😛) for the `FormatArgsExpn` change

Before this change `inputs_span` returned a span pointing to just `1` in

```rust
macro_rules! one {
    () => { 1 };
}

`writeln!(std::io::stderr(), "macro arg {}", one!()).unwrap();`
```

And the `source_callsite` of that span didn't include the format string, it was just `one!()`
2022-02-05 17:44:37 +00:00
..
2022-02-01 15:05:20 -05:00
2021-12-13 00:00:51 +00:00
2021-12-13 00:00:51 +00:00
2021-12-13 00:00:51 +00:00
2021-12-13 00:00:51 +00:00
2021-12-13 17:09:16 +00:00
2022-01-30 15:39:47 +09:00
2022-01-30 15:39:47 +09:00
2022-01-30 15:39:47 +09:00
2022-02-01 13:44:24 +09:00
2022-02-01 13:44:24 +09:00
2021-12-13 00:00:51 +00:00
2021-12-13 00:00:51 +00:00
2022-01-16 09:20:33 -08:00
2022-01-16 09:20:33 -08:00
2022-01-12 20:57:50 -05:00
2021-12-12 12:34:21 +00:00
2021-12-12 12:34:21 +00:00