about summary refs log tree commit diff
path: root/src/libstd/io
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2018-08-06 14:39:55 +0200
committerRalf Jung <post@ralfj.de>2018-08-06 14:39:55 +0200
commit645388583ca47357a6a2e5878a9cde84e2e579d3 (patch)
treeb540ad370e3d571608473073de8de219bda2aff9 /src/libstd/io
parentab3e4a27894295ec0fca28b492450f2b22fbad4e (diff)
downloadrust-645388583ca47357a6a2e5878a9cde84e2e579d3.tar.gz
rust-645388583ca47357a6a2e5878a9cde84e2e579d3.zip
actually, reentrant uninitialized mutex acquisition is outright UB
Diffstat (limited to 'src/libstd/io')
-rw-r--r--src/libstd/io/lazy.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstd/io/lazy.rs b/src/libstd/io/lazy.rs
index 9513cc7fb2d..5743ea51af3 100644
--- a/src/libstd/io/lazy.rs
+++ b/src/libstd/io/lazy.rs
@@ -29,9 +29,8 @@ impl<T: Send + Sync + 'static> Lazy<T> {
     /// Safety: `init` must not call `get` on the variable that is being
     /// initialized.
     pub const unsafe fn new(init: fn() -> Arc<T>) -> Lazy<T> {
-        // `lock` is never initialized fully, so this mutex is reentrant!
-        // Do not use it in a way that might be reentrant, that could lead to
-        // aliasing `&mut`.
+        // `lock` is never initialized fully, so it is UB to attempt to
+        // acquire this mutex reentrantly!
         Lazy {
             lock: Mutex::new(),
             ptr: Cell::new(ptr::null_mut()),