-
Notifications
You must be signed in to change notification settings - Fork 13.4k
"consider using a semicolon here" when ; is present with dbg!() inside inspect() #81943
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
The problem is we look at the macro-expanded code when generating this suggestion, which looks like this: fn main() {
let sum: i32 = [1, 2, 3]
.iter()
.inspect(|n| match n {
tmp => {
... macro-generated stuff here ...
tmp
}
})
.sum();
} Note that there are braces around The problem is it's looking at macro-expanded code and making the suggestion based on that. I can think of a few ways of improving this error:
|
…n-here, r=estebank Do not consider using a semicolon inside of a different-crate macro Fixes rust-lang#81943
…n-here, r=estebank Do not consider using a semicolon inside of a different-crate macro Fixes rust-lang#81943
…n-here, r=estebank Do not consider using a semicolon inside of a different-crate macro Fixes rust-lang#81943
…n-here, r=estebank Do not consider using a semicolon inside of a different-crate macro Fixes rust-lang#81943
This will suggest adding a
;
But doing so will "break" the code even more and not fix the error:
Could rust suggest adding
{ }
around the macro?The text was updated successfully, but these errors were encountered: