You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The difference in behaviour between the two arms can be observed by directly calling utils::snippet with either arms[0].body.span or arms[1].body.span.
This calls a method on LintContext session…
Can this be fixed on clippy side or should it be on rustc ?
I am not quite sure where to go from here.
We should be checking the span for macro expansions and not produce a snippet in that case (or change it to approximate_suggestion and insert a placeholder
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#1148Fixes#1628Fixes#2455Fixes#3023Fixes#3333Fixes#3360
Co-authored-by: Jane Lusby <[email protected]>
Co-authored-by: Philipp Hansch <[email protected]>
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: