-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
literal_string_with_formatting_args is trigger by Actix Web's wildcard route definitions #13928
Comments
|
ClickHouse's query parameters use |
I have another weird case, which I think is slightly different:
I wonder why clippy is linting our clippy.toml 🤔 |
That's most likely #13885 (it's emitting a warning on a dummy span at position 0 which happens to be where clippy.toml is located in the source map) |
cc @GuillaumeGomez (lint author). It seems unfortunate that users of several popular crates that happen to share syntax with that of format strings can run into false positives with this and have to add If there's no trivial or obvious fix, we might just want to (temporarily) move the lint to nursery, just to have more time on this before it makes it to stable because the lint is already on beta. We'll also probably want to backport a fix, which a category change would likely be the easiest. |
Ah... I think I misunderstood this issue. I thought the issue here would be different from #13885 in that the lint thinks that the Looking closer at the repro in the OP though (specifically the span of the warning and what it points at; it doesn't cover the whole I also couldn't really repro the warning for actix_web in the OP locally (after having fixed some of the type errors in the snippet). There are two other comments here where I'm not quite sure if they're the same or the issue that I described though (and it's a bit hard to tell because they don't have a reproducer). So yeah, if that fixes all issues, that should be fine, then. Bit of a confusing situation though ^^ |
This commit fixes clippy warning `useless_conversion`. In addition, a false positive rule `literal_string_with_formatting_args` was introduced in the nightly toolchain, which we will ignore for now. Ref: rust-lang/rust-clippy#13928 Signed-off-by: Yu Li <[email protected]>
This commit fixes clippy warning `useless_conversion`. Also, a false positive rule `literal_string_with_formatting_args` is introduced in the nightly toolchain, we cannot `allow` it because it is a new rule that does not exist in the stable toolchain, so we should ignore it manually. Ref: rust-lang/rust-clippy#13928 Signed-off-by: Yu Li <[email protected]>
* chore(volo): bump volo to 0.10.4 * chore: fix some clippy warnings This commit fixes clippy warning `useless_conversion`. Also, a false positive rule `literal_string_with_formatting_args` is introduced in the nightly toolchain, we cannot `allow` it because it is a new rule that does not exist in the stable toolchain, so we should ignore it manually. Ref: rust-lang/rust-clippy#13928 --------- Signed-off-by: Yu Li <[email protected]>
This is a little more obscure, perhaps, but seed 0.9.2's Would it make sense to be able to configure a list of Edit: I just updated my rustc, and see this on the following version:
Specifically, I get: $ cargo clippy
warning: this looks like a formatting argument but it is not part of a formatting macro
--> datagen-client/src/update/project_reading.rs:304:56
|
304 | ::seed::log!("Error getting media devices: {:?}", sopt);
| ^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#literal_string_with_formatting_args
= note: `#[warn(clippy::literal_string_with_formatting_args)]` on by default |
Summary
Actix Web (https://crates.io/crates/actix-web) supports wildcard in their HTTP route definition macro. It looks something like
#[post("/path/{variable:.*}")]
. This triggersliteral_string_with_formatting_args
incorrectly.As a work around we're adding
#![allow(clippy::literal_string_with_formatting_args)]
to all our files.Lint Name
literal_string_with_formatting_args
Reproducer
I tried this code:
Creates (roughly) the following error:
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: