@@ -202,7 +202,7 @@ impl BootInformationInner {
202202#[ repr( transparent) ]
203203pub struct BootInformation < ' a > ( & ' a BootInformationInner ) ;
204204
205- impl BootInformation < ' _ > {
205+ impl < ' a > BootInformation < ' a > {
206206 /// Loads the [`BootInformation`] from a pointer. The pointer must be valid
207207 /// and aligned to an 8-byte boundary, as defined by the spec.
208208 ///
@@ -454,10 +454,10 @@ impl BootInformation<'_> {
454454 /// .unwrap();
455455 /// assert_eq!(tag.name(), Ok("name"));
456456 /// ```
457- pub fn get_tag < TagT : TagTrait + ?Sized , TagType : Into < TagTypeId > > (
458- & self ,
457+ pub fn get_tag < TagT : TagTrait + ?Sized + ' a , TagType : Into < TagTypeId > > (
458+ & ' a self ,
459459 typ : TagType ,
460- ) -> Option < & TagT > {
460+ ) -> Option < & ' a TagT > {
461461 let typ = typ. into ( ) ;
462462 self . tags ( )
463463 . find ( |tag| tag. typ == typ)
@@ -553,8 +553,8 @@ pub trait TagTrait: Pointee {
553553 /// sane and the underlying memory valid. The implementation of this trait
554554 /// **must have** a correct [`Self::dst_size`] implementation.
555555 unsafe fn from_base_tag < ' a > ( tag : & Tag ) -> & ' a Self {
556- let ptr = tag as * const _ as * const ( ) ;
557- let ptr = ptr_meta:: from_raw_parts ( ptr, Self :: dst_size ( tag) ) ;
556+ let ptr = core :: ptr :: addr_of! ( * tag ) ;
557+ let ptr = ptr_meta:: from_raw_parts ( ptr. cast ( ) , Self :: dst_size ( tag) ) ;
558558 & * ptr
559559 }
560560}
0 commit comments