Home
last modified time | relevance | path

Searched refs:NonZeroUsize (Results 1 – 8 of 8) sorted by relevance

/linux/rust/zerocopy/src/
H A Dlayout.rs12 use core::{mem, num::NonZeroUsize};
34 pub(crate) align: NonZeroUsize,
76 const fn try_to_nonzero_elem_size(&self) -> Option<SizeInfo<NonZeroUsize>> { in try_to_nonzero_elem_size() argument
80 if let Some(elem_size) = NonZeroUsize::new(elem_size) { in try_to_nonzero_elem_size()
107 const MIN_ALIGN: NonZeroUsize = match NonZeroUsize::new(1) {
117 pub(crate) const THEORETICAL_MAX_ALIGN: NonZeroUsize =
118 match NonZeroUsize::new(1 << (POINTER_WIDTH_BITS - 1)) {
131 pub(crate) const CURRENT_MAX_ALIGN: NonZeroUsize = match NonZeroUsize::new(1 << 28) {
138 pub(crate) const CURRENT_MAX_ALIGN: NonZeroUsize = match NonZeroUsize::new(1 << 15) {
185 pub const fn new_zst(repr_align: Option<NonZeroUsize>) -> DstLayout { in new_zst()
[all …]
H A Dlib.rs381 NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize, Wrapping,
1108 NonZeroU64, NonZeroI64, NonZeroU128, NonZeroI128, NonZeroUsize, NonZeroIsize
6512 align: NonZeroUsize::new(align).unwrap(), in test_known_layout()
6586 align: NonZeroUsize::new(align).unwrap(), in test_known_layout_derive()
6592 align: NonZeroUsize::new(align).unwrap(), in test_known_layout_derive()
6730 let repr_align = NonZeroUsize::new(64); in test_known_layout_derive()
6746 let repr_packed = NonZeroUsize::new(1); in test_known_layout_derive()
6762 let repr_packed = NonZeroUsize::new(2); in test_known_layout_derive()
6793 let repr_align = NonZeroUsize::new(64); in test_known_layout_derive()
6809 let repr_packed = NonZeroUsize::new(1); in test_known_layout_derive()
[all …]
H A Dimpls.rs238 unsafe_impl!(NonZeroUsize: Immutable, IntoBytes);
251 NonZeroUsize[usize],
293 unsafe_impl!(Option<NonZeroUsize>: TryFromBytes, FromZeros, FromBytes, IntoBytes);
1521 NonZeroUsize, NonZeroIsize in test_impls()
2176 NonZeroUsize: KnownLayout, in test_impls()
2202 …assert_impls!(Option<NonZeroUsize>: KnownLayout, Immutable, TryFromBytes, FromZeros, FromBytes, In… in test_impls()
/linux/rust/zerocopy/src/util/
H A Dmod.rs20 num::NonZeroUsize,
155 pub(crate) const fn padding_needed_for(len: usize, align: NonZeroUsize) -> usize { in padding_needed_for()
238 align: NonZeroUsize, in round_down_to_next_multiple_of_alignment() argument
258 pub(crate) const fn max(a: NonZeroUsize, b: NonZeroUsize) -> NonZeroUsize { in max() argument
268 pub(crate) const fn min(a: NonZeroUsize, b: NonZeroUsize) -> NonZeroUsize { in min() argument
898 fn alt_impl(n: usize, align: NonZeroUsize) -> usize { in test_round_down_to_next_multiple_of_alignment()
905 let align = NonZeroUsize::new(align).unwrap(); in test_round_down_to_next_multiple_of_alignment()
917 round_down_to_next_multiple_of_alignment(0, NonZeroUsize::new(3).unwrap()); in test_round_down_to_next_multiple_of_alignment_zerocopy_panic_in_const_and_vec_try_reserve()
H A Dmacro_util.rs951 use core::num::NonZeroUsize;
1151 …assert_eq!(struct_padding!(Test, None::<NonZeroUsize>, None::<NonZeroUsize>, [$($ts),*]), $expect); in test_struct_padding()
1182 …assert_eq!(repr_c_struct_has_padding!(Test, None::<NonZeroUsize>, None::<NonZeroUsize>, [$($ts),*]… in test_repr_c_struct_padding()
1218 … assert_eq!(union_padding!(Test, None::<NonZeroUsize>, None::<usize>, [$($ts),*]), $expect); in test_union_padding()
1257 … enum_padding!(Test, None::<NonZeroUsize>, None::<NonZeroUsize>, $disc, $([$($ts),*]),*), in test_enum_padding()
/linux/rust/zerocopy-derive/derive/
H A Dknown_layout.rs27 quote!(#core::num::NonZeroUsize::new(#align as usize)) in derive_known_layout_for_repr_c_struct()
34 quote!(#core::num::NonZeroUsize::new(#packed as usize)) in derive_known_layout_for_repr_c_struct()
/linux/rust/pin-init/src/
H A Dlib.rs
/linux/rust/zerocopy-derive/
H A Dutil.rs584 let nonzero = quote! { #core::num::NonZeroUsize }; in build()