Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Parse error for #[cfg] in struct initializer #334

Closed
eqrion opened this issue Jan 18, 2018 · 2 comments
Closed

Parse error for #[cfg] in struct initializer #334

eqrion opened this issue Jan 18, 2018 · 2 comments

Comments

@eqrion
Copy link

eqrion commented Jan 18, 2018

struct Foo {
    #[cfg(windows)]
    x: i32,
}

pub fn foo() {
    Foo {
        #[cfg(windows)]
        x: 0,
    };
}

Testing on 0.12.6 with features ["extra-traits", "full"], I get a parse error for the above rust code which seems to compile fine with rustc 1.22.1.

@dtolnay
Copy link
Owner

dtolnay commented Jan 19, 2018

Thanks! I released 0.12.7 with a fix.

@eqrion
Copy link
Author

eqrion commented Jan 19, 2018

Thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants