-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
emit suggestion byte literal is passed to
format!
- Loading branch information
1 parent
e1d49aa
commit f56034e
Showing
5 changed files
with
61 additions
and
15 deletions.
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
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,11 @@ | ||
use std::fmt::Write; | ||
|
||
fn main() { | ||
println!(b"foo"); | ||
//~^ ERROR format argument must be a string literal | ||
//~| HELP consider removing the leading `b` | ||
let mut s = String::new(); | ||
write!(s, b"foo{}", "bar"); | ||
//~^ ERROR format argument must be a string literal | ||
//~| HELP consider removing the leading `b` | ||
} |
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,18 @@ | ||
error: format argument must be a string literal | ||
--> $DIR/issue-86865.rs:4:14 | ||
| | ||
LL | println!(b"foo"); | ||
| -^^^^^ | ||
| | | ||
| help: consider removing the leading `b` | ||
|
||
error: format argument must be a string literal | ||
--> $DIR/issue-86865.rs:8:15 | ||
| | ||
LL | write!(s, b"foo{}", "bar"); | ||
| -^^^^^^^ | ||
| | | ||
| help: consider removing the leading `b` | ||
|
||
error: aborting due to 2 previous errors | ||
|