Skip to content

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

Closed
@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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions