enum variant ctor inherits stability of variant

This commit is contained in:
Michael Goulet 2022-08-11 22:20:35 +00:00
parent 569788e47e
commit b821ce6097
3 changed files with 17 additions and 1 deletions

View File

@ -460,7 +460,7 @@ fn visit_variant(&mut self, var: &'tcx Variant<'tcx>) {
AnnotationKind::Required,
InheritDeprecation::Yes,
InheritConstStability::No,
InheritStability::No,
InheritStability::Yes,
|_| {},
);
}

View File

@ -0,0 +1,8 @@
#![crate_type = "lib"]
#![feature(staged_api)]
#![stable(feature = "none", since = "1.0")]
#[stable(feature = "none", since = "1.0")]
pub enum Foo {
A,
}

View File

@ -0,0 +1,8 @@
// aux-build:ctor-stability.rs
// check-pass
extern crate ctor_stability;
fn main() {
let _ = ctor_stability::Foo::A;
}