Skip to content

Commit a994fbb

Browse files
authored
Rollup merge of rust-lang#129487 - GrigorenkoPV:repr_transparent_external_private_fields, r=compiler-errors
repr_transparent_external_private_fields: special-case some std types Fixes rust-lang#129470 ```@rustbot``` label +A-lint +L-repr_transparent_external_private_fields
2 parents 3a33922 + f965950 commit a994fbb

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

Diff for: core/src/cell.rs

+3
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ pub use once::OnceCell;
306306
/// See the [module-level documentation](self) for more.
307307
#[stable(feature = "rust1", since = "1.0.0")]
308308
#[repr(transparent)]
309+
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
309310
pub struct Cell<T: ?Sized> {
310311
value: UnsafeCell<T>,
311312
}
@@ -2055,6 +2056,7 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
20552056
#[lang = "unsafe_cell"]
20562057
#[stable(feature = "rust1", since = "1.0.0")]
20572058
#[repr(transparent)]
2059+
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
20582060
pub struct UnsafeCell<T: ?Sized> {
20592061
value: T,
20602062
}
@@ -2297,6 +2299,7 @@ impl<T> UnsafeCell<*mut T> {
22972299
/// See [`UnsafeCell`] for details.
22982300
#[unstable(feature = "sync_unsafe_cell", issue = "95439")]
22992301
#[repr(transparent)]
2302+
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
23002303
pub struct SyncUnsafeCell<T: ?Sized> {
23012304
value: UnsafeCell<T>,
23022305
}

Diff for: core/src/mem/manually_drop.rs

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ use crate::ptr;
4747
#[lang = "manually_drop"]
4848
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
4949
#[repr(transparent)]
50+
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
5051
pub struct ManuallyDrop<T: ?Sized> {
5152
value: T,
5253
}

Diff for: core/src/mem/maybe_uninit.rs

+1
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ use crate::{fmt, intrinsics, ptr, slice};
237237
#[lang = "maybe_uninit"]
238238
#[derive(Copy)]
239239
#[repr(transparent)]
240+
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
240241
pub union MaybeUninit<T> {
241242
uninit: (),
242243
value: ManuallyDrop<T>,

Diff for: core/src/pin.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,7 @@ use crate::{cmp, fmt};
10841084
#[lang = "pin"]
10851085
#[fundamental]
10861086
#[repr(transparent)]
1087+
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
10871088
#[derive(Copy, Clone)]
10881089
pub struct Pin<Ptr> {
10891090
// FIXME(#93176): this field is made `#[unstable] #[doc(hidden)] pub` to:

0 commit comments

Comments
 (0)