Skip to content

Commit

Permalink
Document why the volatile read is used
Browse files Browse the repository at this point in the history
  • Loading branch information
gnzlbg committed Mar 26, 2019
1 parent 1ea57aa commit 3b6b489
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libcore/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ pub fn black_box<T>(dummy: T) -> T {
)
)
)] {
// asm.js and emscripten do not support inline assembly
unsafe {
let ret = crate::ptr::read_volatile(&dummy);
crate::mem::forget(dummy);
Expand Down

0 comments on commit 3b6b489

Please sign in to comment.