Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
huonw opened this issue Mar 2, 2015 · 1 comment

Comments

@huonw
Copy link
Member

huonw commented Mar 2, 2015

#![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.

huonw added a commit to huonw/rust that referenced this issue Mar 2, 2015
@huonw
Copy link
Member Author

huonw commented Mar 3, 2015

As @alexcrichton points out in #22952 (comment) this isn't a bug; I didn't realise that stability propagation literally just ignores #[stable], meaning core::iter::Scan::state is unstable due to the #[unstable] on core. Closing.

@huonw huonw closed this as completed Mar 3, 2015
Manishearth added a commit to Manishearth/rust that referenced this issue Mar 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant