Skip to content

unused_parens is not emitted for exprs used in macro. #70076

Open
@lcnr

Description

@lcnr
fn main() {
    let x = vec![((8))];
    println!("Hello, world!, {:?}",x);
}

and

fn main() {
    println!("Hello, world!, {:?}", ((8)));
}

do not have any warnings while

fn main() {
    let x = ((8));
    println!("Hello, world!, {:?}",x);
}

emits unused_parens.

I expect the first two snippets to also cause this warning.


note: is there a way to add labels to an issue without being a member?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.L-false-negativeLint: False negative (should have fired but didn't).L-unused_parensLint: unused_parensT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions