-
-
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
Clippy unused_unit warning in generated code #2532
Comments
For query strings, we generate using something like the following: let (#(#ident),*) = {
// query parsing code ...
(#(#ident.unwrap()),*)
}; Where let () = {
// query parsing code ...
()
}; This is what clippy complains about, as this is equivalent to:
Which resolves the clippy warning. In general, our stance is that clippy should not emit warnings for proc-macro generate code. As you can see, this warning is emitted because our code generation is generic to the number of identifiers. "Fixing" this in Rocket would mean creating a special case for when there are no dynamic parameters, which seems completely unnecessary. I would suggest filing an issue with Clippy. In any case, I'll investigate silencing clippy for Rocket's codegen altogether. |
For posterity, c1ead84 silences this warning, and any like it in the future. |
Description
In some circumstances, a route handler will introduce a Clippy warning. Because the warning is in generated code, this is hard to suppress selectively.
To Reproduce
creates the error
with the generated code
Expected Behavior
No warning
Environment:
The text was updated successfully, but these errors were encountered: