core: erase redundant stability attrs in va_list
Now that VaList, et al. have a module, they only need one `#[unstable]`.
This commit is contained in:
parent
c147805a6a
commit
c1a29b30d1
@ -24,12 +24,6 @@
|
|||||||
windows,
|
windows,
|
||||||
))]
|
))]
|
||||||
#[cfg_attr(not(doc), repr(transparent))] // work around https://github.com/rust-lang/rust/issues/90435
|
#[cfg_attr(not(doc), repr(transparent))] // work around https://github.com/rust-lang/rust/issues/90435
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
#[lang = "va_list"]
|
#[lang = "va_list"]
|
||||||
pub struct VaListImpl<'f> {
|
pub struct VaListImpl<'f> {
|
||||||
ptr: *mut c_void,
|
ptr: *mut c_void,
|
||||||
@ -51,12 +45,6 @@ pub struct VaListImpl<'f> {
|
|||||||
target_os = "uefi",
|
target_os = "uefi",
|
||||||
windows,
|
windows,
|
||||||
))]
|
))]
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
impl<'f> fmt::Debug for VaListImpl<'f> {
|
impl<'f> fmt::Debug for VaListImpl<'f> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
write!(f, "va_list* {:p}", self.ptr)
|
write!(f, "va_list* {:p}", self.ptr)
|
||||||
@ -76,12 +64,6 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|||||||
))]
|
))]
|
||||||
#[cfg_attr(not(doc), repr(C))] // work around https://github.com/rust-lang/rust/issues/66401
|
#[cfg_attr(not(doc), repr(C))] // work around https://github.com/rust-lang/rust/issues/66401
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
#[lang = "va_list"]
|
#[lang = "va_list"]
|
||||||
pub struct VaListImpl<'f> {
|
pub struct VaListImpl<'f> {
|
||||||
stack: *mut c_void,
|
stack: *mut c_void,
|
||||||
@ -96,12 +78,6 @@ pub struct VaListImpl<'f> {
|
|||||||
#[cfg(all(target_arch = "powerpc", not(target_os = "uefi"), not(windows)))]
|
#[cfg(all(target_arch = "powerpc", not(target_os = "uefi"), not(windows)))]
|
||||||
#[cfg_attr(not(doc), repr(C))] // work around https://github.com/rust-lang/rust/issues/66401
|
#[cfg_attr(not(doc), repr(C))] // work around https://github.com/rust-lang/rust/issues/66401
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
#[lang = "va_list"]
|
#[lang = "va_list"]
|
||||||
pub struct VaListImpl<'f> {
|
pub struct VaListImpl<'f> {
|
||||||
gpr: u8,
|
gpr: u8,
|
||||||
@ -116,12 +92,6 @@ pub struct VaListImpl<'f> {
|
|||||||
#[cfg(target_arch = "s390x")]
|
#[cfg(target_arch = "s390x")]
|
||||||
#[cfg_attr(not(doc), repr(C))] // work around https://github.com/rust-lang/rust/issues/66401
|
#[cfg_attr(not(doc), repr(C))] // work around https://github.com/rust-lang/rust/issues/66401
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
#[lang = "va_list"]
|
#[lang = "va_list"]
|
||||||
pub struct VaListImpl<'f> {
|
pub struct VaListImpl<'f> {
|
||||||
gpr: i64,
|
gpr: i64,
|
||||||
@ -135,12 +105,6 @@ pub struct VaListImpl<'f> {
|
|||||||
#[cfg(all(target_arch = "x86_64", not(target_os = "uefi"), not(windows)))]
|
#[cfg(all(target_arch = "x86_64", not(target_os = "uefi"), not(windows)))]
|
||||||
#[cfg_attr(not(doc), repr(C))] // work around https://github.com/rust-lang/rust/issues/66401
|
#[cfg_attr(not(doc), repr(C))] // work around https://github.com/rust-lang/rust/issues/66401
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
#[lang = "va_list"]
|
#[lang = "va_list"]
|
||||||
pub struct VaListImpl<'f> {
|
pub struct VaListImpl<'f> {
|
||||||
gp_offset: i32,
|
gp_offset: i32,
|
||||||
@ -153,12 +117,6 @@ 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
|
#[cfg_attr(not(doc), repr(transparent))] // work around https://github.com/rust-lang/rust/issues/90435
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
pub struct VaList<'a, 'f: 'a> {
|
pub struct VaList<'a, 'f: 'a> {
|
||||||
#[cfg(any(
|
#[cfg(any(
|
||||||
all(
|
all(
|
||||||
@ -203,12 +161,6 @@ pub struct VaList<'a, 'f: 'a> {
|
|||||||
target_os = "uefi",
|
target_os = "uefi",
|
||||||
windows,
|
windows,
|
||||||
))]
|
))]
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
impl<'f> VaListImpl<'f> {
|
impl<'f> VaListImpl<'f> {
|
||||||
/// Convert a `VaListImpl` into a `VaList` that is binary-compatible with C's `va_list`.
|
/// Convert a `VaListImpl` into a `VaList` that is binary-compatible with C's `va_list`.
|
||||||
#[inline]
|
#[inline]
|
||||||
@ -229,12 +181,6 @@ pub fn as_va_list<'a>(&'a mut self) -> VaList<'a, 'f> {
|
|||||||
not(target_os = "uefi"),
|
not(target_os = "uefi"),
|
||||||
not(windows),
|
not(windows),
|
||||||
))]
|
))]
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
impl<'f> VaListImpl<'f> {
|
impl<'f> VaListImpl<'f> {
|
||||||
/// Convert a `VaListImpl` into a `VaList` that is binary-compatible with C's `va_list`.
|
/// Convert a `VaListImpl` into a `VaList` that is binary-compatible with C's `va_list`.
|
||||||
#[inline]
|
#[inline]
|
||||||
@ -243,12 +189,6 @@ pub fn as_va_list<'a>(&'a mut self) -> VaList<'a, 'f> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
impl<'a, 'f: 'a> Deref for VaList<'a, 'f> {
|
impl<'a, 'f: 'a> Deref for VaList<'a, 'f> {
|
||||||
type Target = VaListImpl<'f>;
|
type Target = VaListImpl<'f>;
|
||||||
|
|
||||||
@ -258,12 +198,6 @@ fn deref(&self) -> &VaListImpl<'f> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
impl<'a, 'f: 'a> DerefMut for VaList<'a, 'f> {
|
impl<'a, 'f: 'a> DerefMut for VaList<'a, 'f> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn deref_mut(&mut self) -> &mut VaListImpl<'f> {
|
fn deref_mut(&mut self) -> &mut VaListImpl<'f> {
|
||||||
@ -282,22 +216,12 @@ fn deref_mut(&mut self) -> &mut VaListImpl<'f> {
|
|||||||
// improving this.
|
// improving this.
|
||||||
mod sealed_trait {
|
mod sealed_trait {
|
||||||
/// Trait which permits the allowed types to be used with [super::VaListImpl::arg].
|
/// Trait which permits the allowed types to be used with [super::VaListImpl::arg].
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
pub unsafe trait VaArgSafe {}
|
pub unsafe trait VaArgSafe {}
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! impl_va_arg_safe {
|
macro_rules! impl_va_arg_safe {
|
||||||
($($t:ty),+) => {
|
($($t:ty),+) => {
|
||||||
$(
|
$(
|
||||||
#[unstable(feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930")]
|
|
||||||
unsafe impl sealed_trait::VaArgSafe for $t {}
|
unsafe impl sealed_trait::VaArgSafe for $t {}
|
||||||
)+
|
)+
|
||||||
}
|
}
|
||||||
@ -307,27 +231,9 @@ unsafe impl sealed_trait::VaArgSafe for $t {}
|
|||||||
impl_va_arg_safe! {u8, u16, u32, u64, isize}
|
impl_va_arg_safe! {u8, u16, u32, u64, isize}
|
||||||
impl_va_arg_safe! {f64}
|
impl_va_arg_safe! {f64}
|
||||||
|
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
unsafe impl<T> sealed_trait::VaArgSafe for *mut T {}
|
unsafe impl<T> sealed_trait::VaArgSafe for *mut T {}
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
unsafe impl<T> sealed_trait::VaArgSafe for *const T {}
|
unsafe impl<T> sealed_trait::VaArgSafe for *const T {}
|
||||||
|
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
impl<'f> VaListImpl<'f> {
|
impl<'f> VaListImpl<'f> {
|
||||||
/// Advance to the next arg.
|
/// Advance to the next arg.
|
||||||
#[inline]
|
#[inline]
|
||||||
@ -351,12 +257,6 @@ pub unsafe fn with_copy<F, R>(&self, f: F) -> R
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
impl<'f> Clone for VaListImpl<'f> {
|
impl<'f> Clone for VaListImpl<'f> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
@ -369,12 +269,6 @@ fn clone(&self) -> Self {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[unstable(
|
|
||||||
feature = "c_variadic",
|
|
||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
|
||||||
all supported platforms",
|
|
||||||
issue = "44930"
|
|
||||||
)]
|
|
||||||
impl<'f> Drop for VaListImpl<'f> {
|
impl<'f> Drop for VaListImpl<'f> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
// FIXME: this should call `va_end`, but there's no clean way to
|
// FIXME: this should call `va_end`, but there's no clean way to
|
||||||
|
Loading…
Reference in New Issue
Block a user