Skip to content

Commit f501775

Browse files
saethlinRalfJung
andcommitted
Indicate that the warning on black_box is a general property of Rust
And note that the same limitation applies to all LLVM-based compilers Co-authored-by: Ralf Jung <[email protected]>
1 parent 5ae50d3 commit f501775

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)