Rollup merge of #128046 - GrigorenkoPV:90435, r=tgross35

Fix some `#[cfg_attr(not(doc), repr(..))]`

Now that #90435 seems to have been resolved.
This commit is contained in:
Matthias Krüger 2024-07-24 22:22:17 +02:00 committed by GitHub
commit 07947f3773
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 11 additions and 15 deletions

View File

@ -506,7 +506,7 @@ where
/// ``` /// ```
/// ///
#[unstable(feature = "error_generic_member_access", issue = "99301")] #[unstable(feature = "error_generic_member_access", issue = "99301")]
#[cfg_attr(not(doc), repr(transparent))] // work around https://github.com/rust-lang/rust/issues/90435 #[repr(transparent)]
pub struct Request<'a>(Tagged<dyn Erased<'a> + 'a>); pub struct Request<'a>(Tagged<dyn Erased<'a> + 'a>);
impl<'a> Request<'a> { impl<'a> Request<'a> {

View File

@ -103,7 +103,7 @@ use crate::str;
// However, `CStr` layout is considered an implementation detail and must not be relied upon. We // However, `CStr` layout is considered an implementation detail and must not be relied upon. We
// want `repr(transparent)` but we don't want it to show up in rustdoc, so we hide it under // want `repr(transparent)` but we don't want it to show up in rustdoc, so we hide it under
// `cfg(doc)`. This is an ad-hoc implementation of attribute privacy. // `cfg(doc)`. This is an ad-hoc implementation of attribute privacy.
#[cfg_attr(not(doc), repr(transparent))] #[repr(transparent)]
#[allow(clippy::derived_hash_with_manual_eq)] #[allow(clippy::derived_hash_with_manual_eq)]
pub struct CStr { pub struct CStr {
// FIXME: this should not be represented with a DST slice but rather with // FIXME: this should not be represented with a DST slice but rather with

View File

@ -191,7 +191,7 @@ mod c_long_definition {
// be UB. // be UB.
#[doc = include_str!("c_void.md")] #[doc = include_str!("c_void.md")]
#[lang = "c_void"] #[lang = "c_void"]
#[cfg_attr(not(doc), repr(u8))] // work around https://github.com/rust-lang/rust/issues/90435 #[cfg_attr(not(doc), repr(u8))] // An implementation detail we don't want to show up in rustdoc
#[stable(feature = "core_c_void", since = "1.30.0")] #[stable(feature = "core_c_void", since = "1.30.0")]
pub enum c_void { pub enum c_void {
#[unstable( #[unstable(

View File

@ -23,7 +23,7 @@ use crate::ops::{Deref, DerefMut};
target_os = "uefi", target_os = "uefi",
windows, windows,
))] ))]
#[cfg_attr(not(doc), repr(transparent))] // work around https://github.com/rust-lang/rust/issues/90435 #[repr(transparent)]
#[lang = "va_list"] #[lang = "va_list"]
pub struct VaListImpl<'f> { pub struct VaListImpl<'f> {
ptr: *mut c_void, ptr: *mut c_void,
@ -115,7 +115,7 @@ pub struct VaListImpl<'f> {
} }
/// A wrapper for a `va_list` /// A wrapper for a `va_list`
#[cfg_attr(not(doc), repr(transparent))] // work around https://github.com/rust-lang/rust/issues/90435 #[repr(transparent)]
#[derive(Debug)] #[derive(Debug)]
pub struct VaList<'a, 'f: 'a> { pub struct VaList<'a, 'f: 'a> {
#[cfg(any( #[cfg(any(

View File

@ -428,7 +428,7 @@ impl<'a> ContextBuilder<'a> {
/// [`Future::poll()`]: core::future::Future::poll /// [`Future::poll()`]: core::future::Future::poll
/// [`Poll::Pending`]: core::task::Poll::Pending /// [`Poll::Pending`]: core::task::Poll::Pending
/// [`Wake`]: ../../alloc/task/trait.Wake.html /// [`Wake`]: ../../alloc/task/trait.Wake.html
#[cfg_attr(not(doc), repr(transparent))] // work around https://github.com/rust-lang/rust/issues/66401 #[repr(transparent)]
#[stable(feature = "futures_api", since = "1.36.0")] #[stable(feature = "futures_api", since = "1.36.0")]
pub struct Waker { pub struct Waker {
waker: RawWaker, waker: RawWaker,
@ -692,7 +692,7 @@ impl fmt::Debug for Waker {
/// [`Poll::Pending`]: core::task::Poll::Pending /// [`Poll::Pending`]: core::task::Poll::Pending
/// [`local_waker`]: core::task::Context::local_waker /// [`local_waker`]: core::task::Context::local_waker
#[unstable(feature = "local_waker", issue = "118959")] #[unstable(feature = "local_waker", issue = "118959")]
#[cfg_attr(not(doc), repr(transparent))] // work around https://github.com/rust-lang/rust/issues/66401 #[repr(transparent)]
pub struct LocalWaker { pub struct LocalWaker {
waker: RawWaker, waker: RawWaker,
} }

View File

@ -115,10 +115,8 @@ impl crate::sealed::Sealed for OsString {}
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
// `OsStr::from_inner` current implementation relies // `OsStr::from_inner` current implementation relies
// on `OsStr` being layout-compatible with `Slice`. // on `OsStr` being layout-compatible with `Slice`.
// However, `OsStr` layout is considered an implementation detail and must not be relied upon. We // However, `OsStr` layout is considered an implementation detail and must not be relied upon.
// want `repr(transparent)` but we don't want it to show up in rustdoc, so we hide it under #[repr(transparent)]
// `cfg(doc)`. This is an ad-hoc implementation of attribute privacy.
#[cfg_attr(not(doc), repr(transparent))]
pub struct OsStr { pub struct OsStr {
inner: Slice, inner: Slice,
} }

View File

@ -2079,10 +2079,8 @@ impl AsRef<OsStr> for PathBuf {
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
// `Path::new` current implementation relies // `Path::new` current implementation relies
// on `Path` being layout-compatible with `OsStr`. // on `Path` being layout-compatible with `OsStr`.
// However, `Path` layout is considered an implementation detail and must not be relied upon. We // However, `Path` layout is considered an implementation detail and must not be relied upon.
// want `repr(transparent)` but we don't want it to show up in rustdoc, so we hide it under #[repr(transparent)]
// `cfg(doc)`. This is an ad-hoc implementation of attribute privacy.
#[cfg_attr(not(doc), repr(transparent))]
pub struct Path { pub struct Path {
inner: OsStr, inner: OsStr,
} }