1
2use super::imp;
3
4#[repr(transparent)]
6pub struct VaList<'a> {
7 internal: imp::VaList<'a>,
8}
9
10impl<'a> VaList<'a> {
12 pub unsafe fn get<T: VaPrimitive>(&mut self) -> T {
16 T::get(&mut self.internal)
17 }
18}
19
20pub trait VaPrimitive: 'static {
22 #[doc(hidden)]
23 unsafe fn get(_: &mut imp::VaList) -> Self;
24}
25
26#[allow(dead_code)]
27mod check_core_types {
28 struct Foo<T: super::VaPrimitive>([T;0]);
29
30 struct Checks {
31 _ptr: Foo<*const u8>,
32 _usize: Foo<usize>,
33 _isize: Foo<isize>,
34 }
35}
36