Skip to content

Attribute syntax extensions don't expand inside blocks #6727

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
huonw opened this issue May 25, 2013 · 2 comments
Closed

Attribute syntax extensions don't expand inside blocks #6727

huonw opened this issue May 25, 2013 · 2 comments
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-parser Area: The lexing & parsing of Rust source code to an AST A-syntaxext Area: Syntax extensions

Comments

@huonw
Copy link
Member

huonw commented May 25, 2013

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.)

@bblum
Copy link
Contributor

bblum commented Jul 22, 2013

nominating well-covered milestone

@huonw
Copy link
Member Author

huonw commented Jul 23, 2013

Dup of #4913.

@huonw huonw closed this as completed Jul 23, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Mar 25, 2021
wrong_self_convention: `to_` convention respects `Copy` types

fixes rust-lang#6727
changelog: wrong_self_convention: `to_` convention respects `Copy` types
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-parser Area: The lexing & parsing of Rust source code to an AST A-syntaxext Area: Syntax extensions
Projects
None yet
Development

No branches or pull requests

2 participants