@@ -589,7 +589,7 @@ impl FrameBuffer<'_> {
589
589
#[ inline]
590
590
pub unsafe fn write_byte ( & mut self , index : usize , value : u8 ) {
591
591
debug_assert ! ( index < self . size, "Frame buffer accessed out of bounds" ) ;
592
- self . base . add ( index) . write_volatile ( value)
592
+ unsafe { self . base . add ( index) . write_volatile ( value) }
593
593
}
594
594
595
595
/// Read the i-th byte of the frame buffer
@@ -603,7 +603,7 @@ impl FrameBuffer<'_> {
603
603
#[ must_use]
604
604
pub unsafe fn read_byte ( & self , index : usize ) -> u8 {
605
605
debug_assert ! ( index < self . size, "Frame buffer accessed out of bounds" ) ;
606
- self . base . add ( index) . read_volatile ( )
606
+ unsafe { self . base . add ( index) . read_volatile ( ) }
607
607
}
608
608
609
609
/// Write a value in the frame buffer, starting at the i-th byte
@@ -624,8 +624,10 @@ impl FrameBuffer<'_> {
624
624
index. saturating_add( size_of:: <T >( ) ) <= self . size,
625
625
"Frame buffer accessed out of bounds"
626
626
) ;
627
- let ptr = self . base . add ( index) . cast :: < T > ( ) ;
628
- ptr. write_volatile ( value)
627
+ unsafe {
628
+ let ptr = self . base . add ( index) . cast :: < T > ( ) ;
629
+ ptr. write_volatile ( value)
630
+ }
629
631
}
630
632
631
633
/// Read a value from the frame buffer, starting at the i-th byte
@@ -647,6 +649,6 @@ impl FrameBuffer<'_> {
647
649
index. saturating_add( size_of:: <T >( ) ) <= self . size,
648
650
"Frame buffer accessed out of bounds"
649
651
) ;
650
- ( self . base . add ( index) as * const T ) . read_volatile ( )
652
+ unsafe { ( self . base . add ( index) as * const T ) . read_volatile ( ) }
651
653
}
652
654
}
0 commit comments