diff options
| author | Ralf Jung <post@ralfj.de> | 2018-08-30 17:37:58 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2018-08-30 17:37:58 +0200 |
| commit | c06f5517dc00798c85ecad37504ebd0b29ede35a (patch) | |
| tree | 77f7dc6faa122e2ee9c9f533936f3800bde7e1ce | |
| parent | d97f61f10ebfaa57f5010301ebfb60e0701e904f (diff) | |
| download | rust-c06f5517dc00798c85ecad37504ebd0b29ede35a.tar.gz rust-c06f5517dc00798c85ecad37504ebd0b29ede35a.zip | |
improve volatile comments
| -rw-r--r-- | src/libcore/ptr.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index cc42355643e..6e664faa730 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -774,8 +774,8 @@ pub unsafe fn write_unaligned<T>(dst: *mut T, src: T) { /// to not be elided or reordered by the compiler across other volatile /// operations. /// -/// Memory read with `read_volatile` should almost always be written to using -/// [`write_volatile`]. +/// Memory accessed with `read_volatile` or [`write_volatile`] should not be +/// accessed with non-volatile operations. /// /// [`write_volatile`]: ./fn.write_volatile.html /// @@ -844,8 +844,8 @@ pub unsafe fn read_volatile<T>(src: *const T) -> T { /// to not be elided or reordered by the compiler across other volatile /// operations. /// -/// Memory written with `write_volatile` should almost always be read from using -/// [`read_volatile`]. +/// Memory accessed with [`read_volatile`] or `write_volatile` should not be +/// accessed with non-volatile operations. /// /// `write_volatile` does not drop the contents of `dst`. This is safe, but it /// could leak allocations or resources, so care should be taken not to overwrite |
