From 3b6b4899bf699f4098b8cdd773a474b483f23462 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Tue, 26 Mar 2019 13:43:57 +0100 Subject: [PATCH] Document why the volatile read is used --- src/libcore/hint.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcore/hint.rs b/src/libcore/hint.rs index 856720bd55427..6a6f8893bfbd6 100644 --- a/src/libcore/hint.rs +++ b/src/libcore/hint.rs @@ -122,6 +122,7 @@ pub fn black_box(dummy: T) -> T { ) ) )] { + // asm.js and emscripten do not support inline assembly unsafe { let ret = crate::ptr::read_volatile(&dummy); crate::mem::forget(dummy);