Skip to content

Function call with attributes on arguments fail to parse #2521

Closed
@repnop

Description

@repnop

I just ran into a problem with r-a not parsing the function call when I have something like this

fn foo(a: Foo, #[cfg(debug_assertions)] b: Baz) { ... }

// ...

foo(a, #[cfg(debug_assertions)] b);

(r-a says it expects an expression, not attribute)

#1661 fixed the attributes when put on parameters, but not when calling functions with attributes on the arguments.

I did a test with adding AttrsOwner to Expr in the grammar file and that fixed it, but I'm not sure if that's the way to go or not. I could write up a quick PR if its something simple enough that though :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions