@@ -189,8 +189,6 @@ crate::cfg_select! {
189189/// is automatically initialized (equivalent to calling `va_start` in C).
190190///
191191/// ```
192- /// #![feature(c_variadic)]
193- ///
194192/// use std::ffi::VaList;
195193///
196194/// /// # Safety
@@ -224,11 +222,13 @@ crate::cfg_select! {
224222/// terms of layout and ABI.
225223#[ repr( transparent) ]
226224#[ lang = "va_list" ]
225+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
227226pub struct VaList < ' a > {
228227 inner : VaListInner ,
229228 _marker : PhantomCovariantLifetime < ' a > ,
230229}
231230
231+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
232232impl fmt:: Debug for VaList < ' _ > {
233233 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
234234 // No need to include `_marker` in debug output.
@@ -243,6 +243,7 @@ impl VaList<'_> {
243243 }
244244}
245245
246+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
246247#[ rustc_const_unstable( feature = "const_c_variadic" , issue = "151787" ) ]
247248impl < ' f > const Clone for VaList < ' f > {
248249 #[ inline] // Avoid codegen when not used to help backends that don't support VaList.
@@ -255,6 +256,7 @@ impl<'f> const Clone for VaList<'f> {
255256 }
256257}
257258
259+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
258260#[ rustc_const_unstable( feature = "const_c_variadic" , issue = "151787" ) ]
259261impl < ' f > const Drop for VaList < ' f > {
260262 #[ inline] // Avoid codegen when not used to help backends that don't support VaList.
@@ -264,6 +266,7 @@ impl<'f> const Drop for VaList<'f> {
264266 }
265267}
266268
269+ #[ unstable( feature = "c_variadic_internals" , issue = "none" ) ]
267270mod sealed {
268271 pub trait Sealed { }
269272
@@ -318,6 +321,7 @@ mod sealed {
318321// types with an alignment larger than 8, or with a non-scalar layout. Inline assembly can be used
319322// to accept unsupported types in the meantime.
320323#[ lang = "va_arg_safe" ]
324+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
321325pub unsafe trait VaArgSafe : sealed:: Sealed { }
322326
323327crate :: cfg_select! {
@@ -326,7 +330,9 @@ crate::cfg_select! {
326330 //
327331 // - i8 is implicitly promoted to c_int in C, and cannot implement `VaArgSafe`.
328332 // - u8 is implicitly promoted to c_uint in C, and cannot implement `VaArgSafe`.
333+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
329334 unsafe impl VaArgSafe for i16 { }
335+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
330336 unsafe impl VaArgSafe for u16 { }
331337 }
332338 _ => {
@@ -340,6 +346,7 @@ crate::cfg_select! {
340346crate :: cfg_select! {
341347 target_arch = "avr" => {
342348 // c_double is f32 on this target.
349+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
343350 unsafe impl VaArgSafe for f32 { }
344351 }
345352 _ => {
@@ -349,17 +356,26 @@ crate::cfg_select! {
349356 }
350357}
351358
359+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
352360unsafe impl VaArgSafe for i32 { }
361+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
353362unsafe impl VaArgSafe for i64 { }
363+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
354364unsafe impl VaArgSafe for isize { }
355365
366+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
356367unsafe impl VaArgSafe for u32 { }
368+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
357369unsafe impl VaArgSafe for u64 { }
370+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
358371unsafe impl VaArgSafe for usize { }
359372
373+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
360374unsafe impl VaArgSafe for f64 { }
361375
376+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
362377unsafe impl < T > VaArgSafe for * mut T { }
378+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
363379unsafe impl < T > VaArgSafe for * const T { }
364380
365381// Check that relevant `core::ffi` types implement `VaArgSafe`.
@@ -390,6 +406,7 @@ impl<'f> VaList<'f> {
390406 /// Calling this function with an incompatible type, an invalid value, or when there
391407 /// are no more variable arguments, is unsound.
392408 #[ inline] // Avoid codegen when not used to help backends that don't support VaList.
409+ #[ stable( feature = "c_variadic" , since = "CURRENT_RUSTC_VERSION" ) ]
393410 #[ rustc_const_unstable( feature = "const_c_variadic" , issue = "151787" ) ]
394411 pub const unsafe fn next_arg < T : VaArgSafe > ( & mut self ) -> T {
395412 // SAFETY: the caller must uphold the safety contract for `va_arg`.
0 commit comments