Skip to content

Commit 93efe41

Browse files
committed
stabilize transparent_enums
1 parent 900811e commit 93efe41

12 files changed

+8
-130
lines changed

src/doc/unstable-book/src/language-features/transparent-enums.md

-93
This file was deleted.

src/librustc_feature/accepted.rs

+2
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ declare_features! (
257257
/// Allows relaxing the coherence rules such that
258258
/// `impl<T> ForeignTrait<LocalType> for ForeignType<T>` is permitted.
259259
(accepted, re_rebalance_coherence, "1.41.0", Some(55437), None),
260+
/// Allows #[repr(transparent)] on univariant enums (RFC 2645).
261+
(accepted, transparent_enums, "1.42.0", Some(60405), None),
260262
/// Allows using subslice patterns, `[a, .., b]` and `[a, xs @ .., b]`.
261263
(accepted, slice_patterns, "1.42.0", Some(62254), None),
262264

src/librustc_feature/active.rs

-3
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,6 @@ declare_features! (
468468
/// Allows `if/while p && let q = r && ...` chains.
469469
(active, let_chains, "1.37.0", Some(53667), None),
470470

471-
/// Allows #[repr(transparent)] on enums (RFC 2645).
472-
(active, transparent_enums, "1.37.0", Some(60405), None),
473-
474471
/// Allows #[repr(transparent)] on unions (RFC 2645).
475472
(active, transparent_unions, "1.37.0", Some(60405), None),
476473

src/librustc_typeck/check/mod.rs

-10
Original file line numberDiff line numberDiff line change
@@ -2433,16 +2433,6 @@ fn check_transparent(tcx: TyCtxt<'_>, sp: Span, def_id: DefId) {
24332433
}
24342434
let sp = tcx.sess.source_map().def_span(sp);
24352435

2436-
if adt.is_enum() && !tcx.features().transparent_enums {
2437-
feature_err(
2438-
&tcx.sess.parse_sess,
2439-
sym::transparent_enums,
2440-
sp,
2441-
"transparent enums are unstable",
2442-
)
2443-
.emit();
2444-
}
2445-
24462436
if adt.is_union() && !tcx.features().transparent_unions {
24472437
feature_err(
24482438
&tcx.sess.parse_sess,

src/test/codegen/repr-transparent-aggregates-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// ignore-windows
1111
// See repr-transparent.rs
1212

13-
#![feature(transparent_enums, transparent_unions)]
13+
#![feature(transparent_unions)]
1414

1515
#![crate_type="lib"]
1616

src/test/codegen/repr-transparent-aggregates-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// ignore-x86_64
1414
// See repr-transparent.rs
1515

16-
#![feature(transparent_enums, transparent_unions)]
16+
#![feature(transparent_unions)]
1717

1818
#![crate_type="lib"]
1919

src/test/codegen/repr-transparent-aggregates-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// only-mips64
44
// See repr-transparent.rs
55

6-
#![feature(transparent_enums, transparent_unions)]
6+
#![feature(transparent_unions)]
77

88
#![crate_type="lib"]
99

src/test/codegen/repr-transparent.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// compile-flags: -C no-prepopulate-passes
22

33
#![crate_type="lib"]
4-
#![feature(repr_simd, transparent_enums, transparent_unions)]
4+
#![feature(repr_simd, transparent_unions)]
55

66
use std::marker::PhantomData;
77

src/test/ui/feature-gates/feature-gate-transparent_enums.rs

-6
This file was deleted.

src/test/ui/feature-gates/feature-gate-transparent_enums.stderr

-12
This file was deleted.

src/test/ui/lint/lint-ctypes-enum.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(transparent_enums, transparent_unions)]
1+
#![feature(transparent_unions)]
22
#![feature(ptr_internals)]
33
#![deny(improper_ctypes)]
44
#![allow(dead_code)]

src/test/ui/repr/repr-transparent.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// - repr-transparent-other-reprs.rs
44
// - repr-transparent-other-items.rs
55

6-
#![feature(repr_align, transparent_enums, transparent_unions)]
6+
#![feature(transparent_unions)]
77

88
use std::marker::PhantomData;
99

0 commit comments

Comments
 (0)