Lines Matching defs:sized
19 /// The layout of a type which might be dynamically-sized.
21 /// `DstLayout` describes the layout of sized types, slice types, and "slice
462 // zero-sized elements. If it overflows, the complete size cannot fit
565 // complete size sequences agree. This also covers zero-sized elements,
899 /// Constructs a `DstLayout` for a zero-sized type with `repr_align`
1252 // If the trailing field is sized, the resulting layout
1253 // will be sized. Its size will be the sum of the
1275 // If the trailing field is dynamically sized, so too
1361 // For sized layouts, we add the minimum amount of trailing padding
1508 /// Returns `None` if there is no such length, if this describes a sized
1509 /// type, or if the trailing slice element is zero-sized.
1554 /// `Ok((elems, split_at))`. For a dynamically-sized type, `elems` is the
1556 /// For sized types, `elems` is meaningless and should be ignored.
1578 /// - A pointer to the type (for dynamically sized types, this includes
1607 /// DST whose trailing slice element is zero-sized.
1690 None => const_panic!("attempted to cast to slice type with zero-sized element"),
1709 // validly-sized instance which lives at a validly-aligned address
2048 /// Supports casts between sized types of equal size, from a
2049 /// sized type to a slice DST, and between slice DSTs. A slice
2050 /// DST destination must have nonzero-sized elements; between
2315 // cycles with the element count, and zero-sized elements.
2559 // Zero-sized elements can remain representable at usize::MAX.
2714 // `prefix < align`. Move whole alignment-sized chunks of `offset`
2835 // Every count is valid for zero-sized trailing elements.
2845 // Include zero-sized elements, a negative fixed term, fixed
2895 /// Tests of when a sized `DstLayout` is extended with a sized field.
2900 // it with a zero-sized trailing field of the specified alignment. The
2961 /// Tests of when a sized `DstLayout` is extended with a DST field.
2965 // `repr_packed` values, that the extension of a sized `DstLayout`` with
3026 /// Tests that calling `pad_to_align` on a sized `DstLayout` adds the
3431 "attempted to cast to slice type with zero-sized element";
3465 // If this is a sized type (no trailing slice), then `elems` is
3469 let sized = matches!(layout.size_info, SizeInfo::Sized { .. });
3470 assert!(!(sized && elems != 0), "{}", debug_str);
3679 // - For sized types, `without_padding` is just the size of the
3692 // For zero-sized element types,
3729 // For sized casts, the returned element value is
4010 /// Models appending `field` to a sized `prefix` for `DstLayout::extend`.
4055 /// A sized layout rounds its size up to a multiple of `layout.align`. A DST
4067 /// cleared only when a sized layout gains padding; DST padding is accounted
4118 /// the last field may be unsized, since field extension requires a sized
4157 // zero-sized layouts, so the validity assumptions below—not this
4260 // fits in `usize`, including all counts for zero-sized elements.
4586 // branch. A zero-sized layout makes every aligned case succeed and
4737 // The base can only be extended if it's sized.
4805 // If the trailing field is sized, the resulting layout will
4806 // be sized. Its size will be the sum of the preceding
4829 panic!("The composite of two sized layouts must be sized.")
4970 panic!("The padding of a sized layout must result in a sized layout.")
4973 // If the layout is sized, it will remain sized after padding is added.