Skip to content

Various regressions in useless_format and other lints after rust update #4432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
phansch opened this issue Aug 22, 2019 · 3 comments
Closed
Labels
C-bug Category: Clippy is not doing the correct thing

Comments

@phansch
Copy link
Member

phansch commented Aug 22, 2019

I don't know which Rust PR caused these changes unfortunately.

From Travis: https://travis-ci.com/rust-lang/rust-clippy/jobs/227296639#L1078

useless_format

The following 3 examples in useless_format are not linted anymore:

diff of stderr:
 error: useless use of `format!`
-  --> $DIR/format.rs:13:5
-   |
-LL |     format!("foo");
-   |     ^^^^^^^^^^^^^^^ help: consider using .to_string(): `"foo".to_string();`
-   |
-   = note: `-D clippy::useless-format` implied by `-D warnings`
-
-error: useless use of `format!`
-  --> $DIR/format.rs:14:5
-   |
-LL |     format!("{{}}");
-   |     ^^^^^^^^^^^^^^^^ help: consider using .to_string(): `"{}".to_string();`
-
-error: useless use of `format!`
-  --> $DIR/format.rs:15:5
-   |
-LL |     format!("{{}} abc {{}}");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `"{} abc {}".to_string();`
-

zero_width_space, unicode_not_nfc, non_ascii_literal

The stderr files of zero_width_space, non_ascii_literal can probably just be updated, but the suggestion for unicode_not_nfc seems incorrect?

 error: zero-width space detected
   --> $DIR/unicode.rs:3:12
    |
 LL |     print!("Here >​< is a ZWS, and ​another");
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Here >/u{200B}< is a ZWS, and /u{200B}another"`
    |
    = note: `-D clippy::zero-width-space` implied by `-D warnings`

 error: non-nfc unicode sequence detected
   --> $DIR/unicode.rs:9:12
    |
 LL |     print!("̀àh?");
-   |            ^^^^^
+   |            ^^^^^ help: consider replacing the string with: `"̀àh?"`
    |
    = note: `-D clippy::unicode-not-nfc` implied by `-D warnings`
 error: literal non-ASCII character detected
   --> $DIR/unicode.rs:15:12
    |
 LL |     print!("Üben!");
-   |            ^^^^^^^
+   |            ^^^^^^^ help: consider replacing the string with: `"/u{dc}ben!"`
    |
    = note: `-D clippy::non-ascii-literal` implied by `-D warnings`
@phansch phansch added the C-bug Category: Clippy is not doing the correct thing label Aug 22, 2019
@tesuji
Copy link
Contributor

tesuji commented Aug 22, 2019

I would like to work with useless fmt lint.

@phansch
Copy link
Member Author

phansch commented Aug 22, 2019

@lzutao yes sure, go ahead! I wont have time to take a look at this for the next 8 hours at least.

This was referenced Aug 23, 2019
bors added a commit that referenced this issue Aug 23, 2019
Re-factor format lint

cc #4432

changelog: none
@phansch
Copy link
Member Author

phansch commented Aug 23, 2019

Closed by #4439

@phansch phansch closed this as completed Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing
Projects
None yet
Development

No branches or pull requests

2 participants