Skip to content

Stability attributes are required for some inaccessible items #29034

Closed
@petrochenkov

Description

@petrochenkov
#![feature(staged_api)]
#![staged_api]

#[stable(feature="test", since="1.0.0")]
pub const C: u8 = {pub struct S; 1 };
#[stable(feature="test", since="1.0.0")]
pub type T = [u8; { pub struct S; 1 }];

fn main() {}

<anon>:8:20: 8:33 error: This node does not have a stability attribute
<anon>:8 pub const C: u8 = {pub struct S; 1 };
                            ^~~~~~~~~~~~~
<anon>:10:21: 10:34 error: This node does not have a stability attribute
<anon>:10 pub type T = [u8; { pub struct S; 1 }];
                              ^~~~~~~~~~~~~

Noticed while reading stability.rs
This is more amusing, than problematic, but I'll fix it anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-stabilityArea: `#[stable]`, `#[unstable]` etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions