Skip to content

Commit b821ce6

Browse files
enum variant ctor inherits stability of variant
1 parent 569788e commit b821ce6

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

compiler/rustc_passes/src/stability.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
460460
AnnotationKind::Required,
461461
InheritDeprecation::Yes,
462462
InheritConstStability::No,
463-
InheritStability::No,
463+
InheritStability::Yes,
464464
|_| {},
465465
);
466466
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#![crate_type = "lib"]
2+
#![feature(staged_api)]
3+
#![stable(feature = "none", since = "1.0")]
4+
5+
#[stable(feature = "none", since = "1.0")]
6+
pub enum Foo {
7+
A,
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// aux-build:ctor-stability.rs
2+
// check-pass
3+
4+
extern crate ctor_stability;
5+
6+
fn main() {
7+
let _ = ctor_stability::Foo::A;
8+
}

0 commit comments

Comments
 (0)