about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThe 8472 <git@infinite-source.de>2024-06-19 20:01:32 +0200
committerThe 8472 <git@infinite-source.de>2024-06-19 20:01:32 +0200
commit95e214d6e5cbacd4bcc12f449674dbcc3f409a02 (patch)
treeac2083766164c2a905bd7af60bd73fa26db9030f
parent894f7a4ba6554d3797404bbf550d9919df060b97 (diff)
downloadrust-95e214d6e5cbacd4bcc12f449674dbcc3f409a02.tar.gz
rust-95e214d6e5cbacd4bcc12f449674dbcc3f409a02.zip
reword the hint::blackbox non-guarantees
People were tripped up by the "precludes", interpreting it that this function
must not ever be used in cryptographic contexts rather than the std lib merely
making zero promises about it being fit-for-purpose.

What remains unchanged is that if someone does try to use it *despite the warnings*
then it is on them to pin their compiler versions and verify the assembly of every
single binary build they do.
-rw-r--r--library/core/src/hint.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs
index 6e2d88c6b83..c3b16c34293 100644
--- a/library/core/src/hint.rs
+++ b/library/core/src/hint.rs
@@ -263,7 +263,7 @@ pub fn spin_loop() {
 /// extent to which it can block optimisations may vary depending upon the platform and code-gen
 /// backend used. Programs cannot rely on `black_box` for *correctness*, beyond it behaving as the
 /// identity function. As such, it **must not be relied upon to control critical program behavior.**
-/// This _immediately_ precludes any direct use of this function for cryptographic or security
+/// This also means that this function does not offer any guarantees for cryptographic or security
 /// purposes.
 ///
 /// [`std::convert::identity`]: crate::convert::identity