Skip to content

Commit 32e3207

Browse files
authored
Rollup merge of #140341 - saethlin:black-box-qoi, r=Mark-Simulacrum
Clarify black_box warning a bit Trying to bring the docs on black_box more in line with the advice that we have discussed in Zulip. #140341 (comment)
2 parents 6914d83 + f501775 commit 32e3207

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/core/src/hint.rs

+4
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,10 @@ pub fn spin_loop() {
320320
/// This also means that this function does not offer any guarantees for cryptographic or security
321321
/// purposes.
322322
///
323+
/// This limitation is not specific to `black_box`; there is no mechanism in the entire Rust
324+
/// language that can provide the guarantees required for constant-time cryptography.
325+
/// (There is also no such mechanism in LLVM, so the same is true for every other LLVM-based compiler.)
326+
///
323327
/// </div>
324328
///
325329
/// [`std::convert::identity`]: crate::convert::identity

0 commit comments

Comments
 (0)