-
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
Macros are being expanded when emitting suggestions #1148
Comments
This seems to be |
er, |
After doing a bit more research, this only seems to affect match expressions without scope arms. This produces the desired output: fn main() {
let x = Some(1u8);
match x {
Some(y) => {
println!("{:?}", y);
}
_ => (),
}
} results in:
|
Agreed - looks like we're (I'm) not sorting the help with a snippet to be after the ones without snippets. Filed rust-lang/rust#35460 |
@jonathandturner the issue here is not the snippet ordering, but the expansion of 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>
When clippy reports a suggestion with a macro in the code, it seems to print the expanded form. Using the example from README.md, you can see it is not behaving as expected:
results in:
The text was updated successfully, but these errors were encountered: