You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src must point to a properly initialized value of type T.
and the developer who calls the black_box function may not notice this safety requirement.
Marking them unsafe also means that callers must make sure they know what they're doing.
The text was updated successfully, but these errors were encountered:
please explain how black_box has different requirements than on a hypothetical function black_box2:
pubfnblack_box2<T>(dummy:T) -> T{}
I believe a user has to follow the same rules for calling black_box as black_box2, thus there is nothing that needs to be changed. Otherwise, please point out the details
Hello, I found a soundness issue in this crate.
bencher/lib.rs
Lines 590 to 596 in 8afeeb1
https://doc.rust-lang.org/std/ptr/fn.read_volatile.html
The unsafe function called needs to ensure that the parameter must be :
src must be valid for reads.
src must be properly aligned.
src must point to a properly initialized value of type T.
and the developer who calls the black_box function may not notice this safety requirement.
Marking them unsafe also means that callers must make sure they know what they're doing.
The text was updated successfully, but these errors were encountered: