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
Even stranger, the warning is sensitive to how the original function was formatted. I don't think I've ever seen that behavior before 😬. This code has no warnings and only differs in a few newlines:
#[tracing::instrument]fndemo() -> u8{1}
The text was updated successfully, but these errors were encountered:
Even stranger, the warning is sensitive to how the original function was formatted. I don't think I've ever seen that behavior before 😬. This code has no warnings and only differs in a few newlines:
I think there is an issue with the lint. For example this does not create warnings for me (note that there is no macro)
fn demo() -> u8 { {
1
} }
while this creates the unused braces warning (here the suggestion at least does not break the code)
fn demo() -> u8 { { 1 } }
I don't think this whitespace-dependent behavior is intended so it might be worthwhile opening an issue in rust.
I can confirm that no matter the formatting the expanded code is identical. It seems this lint runs on code before macro expansion so I don't think this can be fixed by tracing for example by adding an allow.
Bug Report
Version
Platform
N/A (reproduced on the Rust Playground (x86_64 Linux) and my laptop (aarch64-macos-darwin)
Description
I tried this code:
I expected this to compile with no warnings. Instead, a warning is triggered and the warning would make invalid code:
Even stranger, the warning is sensitive to how the original function was formatted. I don't think I've ever seen that behavior before 😬. This code has no warnings and only differs in a few newlines:
The text was updated successfully, but these errors were encountered: