@@ -309,7 +309,7 @@ pub enum AllocError {
309309 /// Partially copying a pointer.
310310 ReadPartialPointer ( Size ) ,
311311 /// Using uninitialized data where it is not allowed.
312- InvalidUninitBytes ( Option < BadBytesAccess > ) ,
312+ InvalidUninitBytes ( BadBytesAccess ) ,
313313}
314314pub type AllocResult < T = ( ) > = Result < T , AllocError > ;
315315
@@ -336,7 +336,7 @@ impl AllocError {
336336 UnsupportedOpInfo :: ReadPartialPointer ( Pointer :: new ( alloc_id, offset) ) ,
337337 ) ,
338338 InvalidUninitBytes ( info) => InterpErrorKind :: UndefinedBehavior (
339- UndefinedBehaviorInfo :: InvalidUninitBytes ( info . map ( |b| ( alloc_id, b ) ) ) ,
339+ UndefinedBehaviorInfo :: InvalidUninitBytes ( alloc_id, info ) ,
340340 ) ,
341341 }
342342 }
@@ -597,10 +597,7 @@ impl<Prov: Provenance, Extra, Bytes: AllocBytes> Allocation<Prov, Extra, Bytes>
597597 range : AllocRange ,
598598 ) -> AllocResult < & [ u8 ] > {
599599 self . init_mask . is_range_initialized ( range) . map_err ( |uninit_range| {
600- AllocError :: InvalidUninitBytes ( Some ( BadBytesAccess {
601- access : range,
602- bad : uninit_range,
603- } ) )
600+ AllocError :: InvalidUninitBytes ( BadBytesAccess { access : range, bad : uninit_range } )
604601 } ) ?;
605602 if !Prov :: OFFSET_IS_ADDR && !self . provenance . range_empty ( range, cx) {
606603 // Find the provenance.
@@ -701,10 +698,7 @@ impl<Prov: Provenance, Extra, Bytes: AllocBytes> Allocation<Prov, Extra, Bytes>
701698 ) -> AllocResult < Scalar < Prov > > {
702699 // First and foremost, if anything is uninit, bail.
703700 if let Err ( bad) = self . init_mask . is_range_initialized ( range) {
704- return Err ( AllocError :: InvalidUninitBytes ( Some ( BadBytesAccess {
705- access : range,
706- bad,
707- } ) ) ) ;
701+ return Err ( AllocError :: InvalidUninitBytes ( BadBytesAccess { access : range, bad } ) ) ;
708702 }
709703
710704 // Get the integer part of the result. We HAVE TO check provenance before returning this!
0 commit comments