@@ -202,7 +202,7 @@ impl BootInformationInner {
202
202
#[ repr( transparent) ]
203
203
pub struct BootInformation < ' a > ( & ' a BootInformationInner ) ;
204
204
205
- impl BootInformation < ' _ > {
205
+ impl < ' a > BootInformation < ' a > {
206
206
/// Loads the [`BootInformation`] from a pointer. The pointer must be valid
207
207
/// and aligned to an 8-byte boundary, as defined by the spec.
208
208
///
@@ -454,10 +454,10 @@ impl BootInformation<'_> {
454
454
/// .unwrap();
455
455
/// assert_eq!(tag.name(), Ok("name"));
456
456
/// ```
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 ,
459
459
typ : TagType ,
460
- ) -> Option < & TagT > {
460
+ ) -> Option < & ' a TagT > {
461
461
let typ = typ. into ( ) ;
462
462
self . tags ( )
463
463
. find ( |tag| tag. typ == typ)
@@ -553,8 +553,8 @@ pub trait TagTrait: Pointee {
553
553
/// sane and the underlying memory valid. The implementation of this trait
554
554
/// **must have** a correct [`Self::dst_size`] implementation.
555
555
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) ) ;
558
558
& * ptr
559
559
}
560
560
}
0 commit comments