Skip to content

Public struct fields do not (always) get "this node does not have a stability attribute" error #22950

@huonw

Description

@huonw
#![feature(staged_api)]
#![staged_api]
#![crate_type = "lib"]

#![stable(feature = "rust1", since = "1.0.0")]

#[stable(feature = "rust1", since = "1.0.0")]
pub struct Foo {
    pub bar: u8,
}

#[stable(feature = "rust1", since = "1.0.0")]
pub struct Baz(pub u8);

compiles without any error.

Notably this isn't a regression from #22803: I noticed it because core::iter::Scan has a public state field that has had no stability attribute from far before #22803. However, that PR did pick up some structs with missing stability attributes, I'm unsure of the exact circumstances when fields will get the errors or when they will not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions