Skip to content

Attribute syntax extensions don't expand inside blocks #6727

Closed
@huonw

Description

@huonw

The following should work:

fn main() {
     #[deriving(Eq)]
     struct A;

     A == A
}
synext-test.rs:6:4: 6:10 error: binary operation == cannot be applied to type `main::A`
synext-test.rs:6     A == A
                         ^~~~~~
error: aborting due to previous error

The syntax extension is not expanded (this isn't specific to deriving, e.g. using #[auto_encode] would give a compile error if it was expanded, but it passes silently).

(I'm fairly sure this used to work, but I'm not certain.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)A-parserArea: The lexing & parsing of Rust source code to an ASTA-syntaxextArea: Syntax extensions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions