Skip to content

Inner attributes don't parse with impls #8661

Closed
@nikomatsakis

Description

@nikomatsakis
Contributor
struct foo;

impl foo {
    #[cfg(not(test))];

    fn bar() {}
}

fn main() {}

yields

Running /home/nmatsakis/versioned/rust-m/build/i686-unknown-linux-gnu/stage2/bin/rustc:
/home/nmatsakis/tmp/bar.rs:4:21: 4:22 error: unexpected token: `;`
/home/nmatsakis/tmp/bar.rs:4     #[cfg(not(test))];

Activity

huonw

huonw commented on Aug 21, 2013

@huonw
Member

Dup of #3614.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)A-parserArea: The lexing & parsing of Rust source code to an AST

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @nikomatsakis@huonw

        Issue actions

          Inner attributes don't parse with impls · Issue #8661 · rust-lang/rust