Skip to content

#[inline] is allowed on structs inside fns #31769

@solson

Description

@solson

http://is.gd/mRtTeS causes an error, as expected:

#[inline] // error: attribute should be applied to function
struct Foo(usize);

fn main() {
}

http://is.gd/POCLQo should cause the same error, but is allowed:

fn main() {
    #[inline]
    struct Foo(usize);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions