c-variadic functions in rustc_const_eval
This commit is contained in:
parent
ce693807f6
commit
02c4af397e
16 changed files with 908 additions and 33 deletions
|
|
@ -200,12 +200,13 @@ impl fmt::Debug for VaList<'_> {
|
|||
|
||||
impl VaList<'_> {
|
||||
// Helper used in the implementation of the `va_copy` intrinsic.
|
||||
pub(crate) fn duplicate(&self) -> Self {
|
||||
Self { inner: self.inner.clone(), _marker: self._marker }
|
||||
pub(crate) const fn duplicate(&self) -> Self {
|
||||
Self { inner: self.inner, _marker: self._marker }
|
||||
}
|
||||
}
|
||||
|
||||
impl Clone for VaList<'_> {
|
||||
#[rustc_const_unstable(feature = "c_variadic_const", issue = "none")]
|
||||
impl<'f> const Clone for VaList<'f> {
|
||||
#[inline]
|
||||
fn clone(&self) -> Self {
|
||||
// We only implement Clone and not Copy because some future target might not be able to
|
||||
|
|
|
|||
|
|
@ -3484,7 +3484,7 @@ pub const unsafe fn va_arg<T: VaArgSafe>(ap: &mut VaList<'_>) -> T;
|
|||
/// when a variable argument list is used incorrectly.
|
||||
#[rustc_intrinsic]
|
||||
#[rustc_nounwind]
|
||||
pub fn va_copy<'f>(src: &VaList<'f>) -> VaList<'f> {
|
||||
pub const fn va_copy<'f>(src: &VaList<'f>) -> VaList<'f> {
|
||||
src.duplicate()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue