-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove machine applicable suggestion explicit_write format #4542
- Loading branch information
1 parent
535bc1d
commit 24ec994
Showing
3 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#![allow(unused_imports, clippy::blacklisted_name)] | ||
#![warn(clippy::explicit_write)] | ||
|
||
fn main() { | ||
use std::io::Write; | ||
let bar = "bar"; | ||
writeln!(std::io::stderr(), "foo {}", bar).unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error: use of `writeln!(stderr(), ...).unwrap()`. Consider using `eprintln!` instead | ||
--> $DIR/explicit_write_non_rustfix.rs:7:5 | ||
| | ||
LL | writeln!(std::io::stderr(), "foo {}", bar).unwrap(); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `-D clippy::explicit-write` implied by `-D warnings` | ||
|
||
error: aborting due to previous error | ||
|