feature-gate c-variadic definitions and calls in const contexts
This commit is contained in:
parent
f5bf3353e6
commit
981dacc34f
11 changed files with 88 additions and 5 deletions
|
|
@ -205,7 +205,7 @@ impl VaList<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
#[rustc_const_unstable(feature = "c_variadic_const", issue = "none")]
|
||||
#[rustc_const_unstable(feature = "const_c_variadic", issue = "151787")]
|
||||
impl<'f> const Clone for VaList<'f> {
|
||||
#[inline]
|
||||
fn clone(&self) -> Self {
|
||||
|
|
@ -217,7 +217,7 @@ impl<'f> const Clone for VaList<'f> {
|
|||
}
|
||||
}
|
||||
|
||||
#[rustc_const_unstable(feature = "c_variadic_const", issue = "none")]
|
||||
#[rustc_const_unstable(feature = "const_c_variadic", issue = "151787")]
|
||||
impl<'f> const Drop for VaList<'f> {
|
||||
fn drop(&mut self) {
|
||||
// SAFETY: this variable argument list is being dropped, so won't be read from again.
|
||||
|
|
@ -293,7 +293,7 @@ impl<'f> VaList<'f> {
|
|||
///
|
||||
/// [valid]: https://doc.rust-lang.org/nightly/nomicon/what-unsafe-does.html
|
||||
#[inline]
|
||||
#[rustc_const_unstable(feature = "c_variadic_const", issue = "none")]
|
||||
#[rustc_const_unstable(feature = "const_c_variadic", issue = "151787")]
|
||||
pub const unsafe fn arg<T: VaArgSafe>(&mut self) -> T {
|
||||
// SAFETY: the caller must uphold the safety contract for `va_arg`.
|
||||
unsafe { va_arg(self) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue