Skip to content

Compilation succeeds even if there is #[inline] in the structure field. #80564

Closed
@Danue1

Description

@Danue1

I tried this code:

struct Foo {
    #[inline]
    bar: String,
}

I expected to see this happen: Failing complilation.

Instead, this happened: Compilation success.

Meta

rustc --version --verbose:

rustc 1.49.0-beta.4 (877c7cbe1 2020-12-10)
binary: rustc
commit-hash: 877c7cbe142a373f93d38a23741dcc3a0a17a2af
commit-date: 2020-12-10
host: x86_64-apple-darwin
release: 1.49.0-beta.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions