diff options
| author | Alex Macleod <alex@macleod.io> | 2022-08-30 12:20:49 +0000 |
|---|---|---|
| committer | Alex Macleod <alex@macleod.io> | 2022-09-08 20:18:02 +0000 |
| commit | 6fc6d87fd069470893b6a539a46fa1e2f10ae906 (patch) | |
| tree | 91e6053c58bfc7acbbc3a0d6b0c0091f4de3c46b /src | |
| parent | 32fa80dda57f3c468bb290657eb04720144506ab (diff) | |
| download | rust-6fc6d87fd069470893b6a539a46fa1e2f10ae906.tar.gz rust-6fc6d87fd069470893b6a539a46fa1e2f10ae906.zip | |
Migrate write.rs to a late pass
Diffstat (limited to 'src')
| -rw-r--r-- | src/docs.rs | 1 | ||||
| -rw-r--r-- | src/docs/positional_named_format_parameters.txt | 15 | ||||
| -rw-r--r-- | src/docs/print_literal.txt | 4 | ||||
| -rw-r--r-- | src/docs/print_stderr.txt | 8 | ||||
| -rw-r--r-- | src/docs/print_stdout.txt | 8 | ||||
| -rw-r--r-- | src/docs/write_literal.txt | 4 |
6 files changed, 2 insertions, 38 deletions
diff --git a/src/docs.rs b/src/docs.rs index f3a5048e7fa..9f6f1fb4727 100644 --- a/src/docs.rs +++ b/src/docs.rs @@ -391,7 +391,6 @@ docs! { "partialeq_to_none", "path_buf_push_overwrite", "pattern_type_mismatch", - "positional_named_format_parameters", "possible_missing_comma", "precedence", "print_in_format_impl", diff --git a/src/docs/positional_named_format_parameters.txt b/src/docs/positional_named_format_parameters.txt deleted file mode 100644 index e391d240667..00000000000 --- a/src/docs/positional_named_format_parameters.txt +++ /dev/null @@ -1,15 +0,0 @@ -### What it does -This lint warns when a named parameter in a format string is used as a positional one. - -### Why is this bad? -It may be confused for an assignment and obfuscates which parameter is being used. - -### Example -``` -println!("{}", x = 10); -``` - -Use instead: -``` -println!("{x}", x = 10); -``` \ No newline at end of file diff --git a/src/docs/print_literal.txt b/src/docs/print_literal.txt index 160073414f9..a6252a68780 100644 --- a/src/docs/print_literal.txt +++ b/src/docs/print_literal.txt @@ -6,10 +6,6 @@ Using literals as `println!` args is inefficient (c.f., https://github.com/matthiaskrgr/rust-str-bench) and unnecessary (i.e., just put the literal in the format string) -### Known problems -Will also warn with macro calls as arguments that expand to literals --- e.g., `println!("{}", env!("FOO"))`. - ### Example ``` println!("{}", "foo"); diff --git a/src/docs/print_stderr.txt b/src/docs/print_stderr.txt index fc14511cd6a..9c6edeeef12 100644 --- a/src/docs/print_stderr.txt +++ b/src/docs/print_stderr.txt @@ -7,13 +7,7 @@ People often print on *stderr* while debugging an application and might forget to remove those prints afterward. ### Known problems -* Only catches `eprint!` and `eprintln!` calls. -* The lint level is unaffected by crate attributes. The level can still - be set for functions, modules and other items. To change the level for - the entire crate, please use command line flags. More information and a - configuration example can be found in [clippy#6610]. - -[clippy#6610]: https://github.com/rust-lang/rust-clippy/issues/6610#issuecomment-977120558 +Only catches `eprint!` and `eprintln!` calls. ### Example ``` diff --git a/src/docs/print_stdout.txt b/src/docs/print_stdout.txt index 6c9a4b98e1e..d2cbd811d1b 100644 --- a/src/docs/print_stdout.txt +++ b/src/docs/print_stdout.txt @@ -7,13 +7,7 @@ People often print on *stdout* while debugging an application and might forget to remove those prints afterward. ### Known problems -* Only catches `print!` and `println!` calls. -* The lint level is unaffected by crate attributes. The level can still - be set for functions, modules and other items. To change the level for - the entire crate, please use command line flags. More information and a - configuration example can be found in [clippy#6610]. - -[clippy#6610]: https://github.com/rust-lang/rust-clippy/issues/6610#issuecomment-977120558 +Only catches `print!` and `println!` calls. ### Example ``` diff --git a/src/docs/write_literal.txt b/src/docs/write_literal.txt index 9c41a48f9f7..a7a884d0871 100644 --- a/src/docs/write_literal.txt +++ b/src/docs/write_literal.txt @@ -6,10 +6,6 @@ Using literals as `writeln!` args is inefficient (c.f., https://github.com/matthiaskrgr/rust-str-bench) and unnecessary (i.e., just put the literal in the format string) -### Known problems -Will also warn with macro calls as arguments that expand to literals --- e.g., `writeln!(buf, "{}", env!("FOO"))`. - ### Example ``` writeln!(buf, "{}", "foo"); |
