-
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
single-match lint expands println! macro in suggestion #2455
Comments
The issue seems to be more general than just the single arm lint. for example:
The difference in behaviour between the two arms can be observed by directly calling Can this be fixed on clippy side or should it be on rustc ? |
We should be checking the |
3217: Fix string_lit_as_bytes lint for macros r=phansch a=yaahallo Prior to this change, string_lit_as_bytes would trigger for constructs like `include_str!("filename").as_bytes()` and would recommend fixing it by rewriting as `binclude_str!("filename")`. This change updates the lint to act as an EarlyLintPass lint. It then differentiates between string literals and macros that have bytes yielding alternatives. Closes #3205 3366: Don't expand macros in some suggestions r=oli-obk a=phansch Fixes #1148 Fixes #1628 Fixes #2455 Fixes #3023 Fixes #3333 Fixes #3360 Co-authored-by: Jane Lusby <jlusby42@gmail.com> Co-authored-by: Philipp Hansch <dev@phansch.net>
The example in the README file:
produces this suggestions:
Using current master (commit: 6b3487a)
And rustc 1.25.0-nightly (b8398d9 2018-02-11)
Note putting the statement inside a block
{ println!("{:?}", y) }
works properly (and is the current case covered by ui tests).The text was updated successfully, but these errors were encountered: