Open
Description
I tried this code:
macro_rules! neg {
($value: expr) => { -$value }
}
fn test() {
let value = 1;
let _ = neg!(-value);
}
I expected to see this happen: No double_negations warnings
Instead, this happened: double_negations warning
Meta
rustc --version --verbose
:
1.90.0-nightly
(2025-07-14 a001497644bc229f1abc)
(Playgournd)
Metadata
Metadata
Assignees
Labels
Area: Lints (warnings about flaws in source code) such as unused_mut.Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Category: This is a bug.Lint: double_negationsLint: False positive (should not have fired).Relevant to the compiler team, which will review and decide on the PR/issue.