Skip to content

Commit

Permalink
New #[rustc_pub_transparent] attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigorenkoPV committed Aug 24, 2024
1 parent 0803686 commit f965950
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ pub use once::OnceCell;
/// See the [module-level documentation](self) for more.
#[stable(feature = "rust1", since = "1.0.0")]
#[repr(transparent)]
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
pub struct Cell<T: ?Sized> {
value: UnsafeCell<T>,
}
Expand Down Expand Up @@ -2055,6 +2056,7 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
#[lang = "unsafe_cell"]
#[stable(feature = "rust1", since = "1.0.0")]
#[repr(transparent)]
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
pub struct UnsafeCell<T: ?Sized> {
value: T,
}
Expand Down Expand Up @@ -2297,6 +2299,7 @@ impl<T> UnsafeCell<*mut T> {
/// See [`UnsafeCell`] for details.
#[unstable(feature = "sync_unsafe_cell", issue = "95439")]
#[repr(transparent)]
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
pub struct SyncUnsafeCell<T: ?Sized> {
value: UnsafeCell<T>,
}
Expand Down
1 change: 1 addition & 0 deletions core/src/mem/manually_drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ use crate::ptr;
#[lang = "manually_drop"]
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(transparent)]
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
pub struct ManuallyDrop<T: ?Sized> {
value: T,
}
Expand Down
1 change: 1 addition & 0 deletions core/src/mem/maybe_uninit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ use crate::{fmt, intrinsics, ptr, slice};
#[lang = "maybe_uninit"]
#[derive(Copy)]
#[repr(transparent)]
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
pub union MaybeUninit<T> {
uninit: (),
value: ManuallyDrop<T>,
Expand Down
1 change: 1 addition & 0 deletions core/src/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,7 @@ use crate::{cmp, fmt};
#[lang = "pin"]
#[fundamental]
#[repr(transparent)]
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
#[derive(Copy, Clone)]
pub struct Pin<Ptr> {
// FIXME(#93176): this field is made `#[unstable] #[doc(hidden)] pub` to:
Expand Down

0 comments on commit f965950

Please sign in to comment.