File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1749,7 +1749,9 @@ pub const unsafe fn write_unaligned<T>(dst: *mut T, src: T) {
1749
1749
///
1750
1750
/// Volatile operations are intended to act on I/O memory, and are guaranteed
1751
1751
/// to not be elided or reordered by the compiler across other volatile
1752
- /// operations.
1752
+ /// operations. In addition, note that bit-address 0 is legal and can be used
1753
+ /// when it's known to hold I/O memory, so using these operations on a null
1754
+ /// pointer won't panic.
1753
1755
///
1754
1756
/// # Notes
1755
1757
///
@@ -1828,7 +1830,9 @@ pub unsafe fn read_volatile<T>(src: *const T) -> T {
1828
1830
///
1829
1831
/// Volatile operations are intended to act on I/O memory, and are guaranteed
1830
1832
/// to not be elided or reordered by the compiler across other volatile
1831
- /// operations.
1833
+ /// operations. In addition, note that bit-address 0 is legal and can be used
1834
+ /// when it's known to hold I/O memory, so using these operations on a null
1835
+ /// pointer won't panic.
1832
1836
///
1833
1837
/// `write_volatile` does not drop the contents of `dst`. This is safe, but it
1834
1838
/// could leak allocations or resources, so care should be taken not to overwrite
You can’t perform that action at this time.
0 commit comments