Adding print! specially-formatted format!-like macros list

This commit corrects what appears to be an accidental inclusion of
`panic!` twice in the list resulting from the union of ffbe52e and
aeb3398.
This commit is contained in:
David Alber 2017-12-05 16:49:48 -08:00
parent 8c51122f54
commit eb42956e84
3 changed files with 40 additions and 1 deletions

View file

@ -1818,7 +1818,7 @@ const FORMAT_LIKE_WHITELIST: &[&str] = &[
"eprintln!",
"format!",
"format_args!",
"panic!",
"print!",
"println!",
"unreachable!",
// From the `log` crate.

View file

@ -234,6 +234,10 @@ fn special_case_macros() {
let r = format_args!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let s = format_args!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
let q = print!("{}", 1);
let r = print!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let s = print!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
let q = println!("{}", 1);
let r = println!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
let s = println!("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);

View file

@ -411,6 +411,41 @@ fn special_case_macros() {
26
);
let q = print!("{}", 1);
let r = print!(
"{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
);
let s = print!(
"{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
);
let q = println!("{}", 1);
let r = println!(
"{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",