Lines Matching full:alignment

36 //! For [`Unaligned`] destination types, alignment errors are impossible. All
37 //! compound error types support infallibly discarding the alignment error via
71 //! Our conversion methods typically check alignment, then size, then bit
143 /// [`FromBytes::ref_from_bytes`] may fail due to alignment or size issues, but
157 Alignment(A), enumerator
167 /// Infallibly discards the alignment error from this `ConvertError` since
170 /// Since [`Dst: Unaligned`], it is impossible to encounter an alignment
171 /// error. This method permits discarding that alignment error infallibly
194 /// // the alignment error.
202 ConvertError::Alignment(e) => { in from()
204 return ConvertError::Alignment(Infallible::from(e)); in from()
216 Self::Alignment(e) => f.debug_tuple("Alignment").field(e).finish(), in fmt()
232 Self::Alignment(e) => e.fmt(f), in fmt()
256 /// alignment requirement is greater than one.
263 /// The caller must ensure that `Dst`'s alignment requirement is greater
266 // INVARIANT: The caller guarantees that `Dst`'s alignment requirement in new_unchecked()
279 // invariant that `Dst`'s alignment requirement is greater than one is in with_src()
296 /// // Attempt to deref `unaligned`. This might fail with an alignment error.
310 ConvertError::Alignment(self) in into()
337 f.write_str("\nDestination alignment: ")?; in display_verbose_extras()
364 // alignment requirement is greater than one. In this block, `Dst: in from()
365 // Unaligned`, which means that its alignment requirement is equal to in from()
377 // SAFETY: The preceding assertion guarantees that `Dst`'s alignment in new_checked()
402 …rsion failed because the address of the source is not a multiple of the alignment of the destinati… in fmt()
426 Self::Alignment(err) in from()
725 /// [alignment](AlignmentError) and [size](SizeError) errors.
737 Self::Alignment(e) => e.src, in into_src()
746 Self::Alignment(e) => CastError::Alignment(e.with_src(new_src)), in with_src()
776 Self::Alignment(e) => CastError::Alignment(e.map_src(f)), in map_src()
788 Self::Alignment(e) => TryCastError::Alignment(e), in into()
816 /// Since [`Dst: Unaligned`], it is impossible to encounter an alignment
856 CastError::Alignment(e) => match Infallible::from(e) {}, in from()
866 /// may emit [alignment](AlignmentError), [size](SizeError), and
882 Self::Alignment(e) => e.src, in into_src()
914 Self::Alignment(e) => TryCastError::Alignment(e.map_src(f)), in map_src()
925 CastError::Alignment(e) => Self::Alignment(e), in from()
936 /// alignment errors.
948 Self::Alignment(i) => match i {}, in into_src()
980 Self::Alignment(i) => match i {}, in map_src()
990 /// It is identical to `TryCastError`, except that its alignment error is
994 /// However, it is useful since it permits users to infallibly discard alignment
995 /// errors when they can prove statically that alignment errors are impossible.
1015 /// // the alignment error.
1138 …rsion failed because the address of the source is not a multiple of the alignment of the destinati… in alignment_display()
1142 \nDestination alignment: 8", addr) in alignment_display()
1149 …rsion failed because the address of the source is not a multiple of the alignment of the destinati… in alignment_display()
1153 \nDestination alignment: 8", addr) in alignment_display()
1160 …rsion failed because the address of the source is not a multiple of the alignment of the destinati… in alignment_display()
1164 \nDestination alignment: 8", addr) in alignment_display()
1171 …rsion failed because the address of the source is not a multiple of the alignment of the destinati… in alignment_display()
1175 \nDestination alignment: 8", addr) in alignment_display()
1215 > = ConvertError::Alignment(AlignmentError::new_checked(&[0u8])); in test_convert_error_debug()
1216 assert_eq!(format!("{:?}", err), "Alignment(AlignmentError)"); in test_convert_error_debug()
1276 > = ConvertError::Alignment(AlignmentError::new_checked(&[0u8])); in test_convert_error_display_debug_more()
1309 ConvertError::Alignment(_) => {} in test_alignment_error_methods()
1310 _ => panic!("Expected Alignment error"), in test_alignment_error_methods()