We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f13be2 commit b65b5efCopy full SHA for b65b5ef
library/core/src/hint.rs
@@ -320,6 +320,8 @@ pub fn spin_loop() {
320
/// to the function, though.
321
///
322
/// ```
323
+/// # use std::hint::black_box;
324
+/// #
325
/// // This...
326
/// let y = black_box(5 * 10);
327
/// // ...will still be optimized to this:
@@ -330,6 +332,8 @@ pub fn spin_loop() {
330
332
/// moving the multiplication outside of `black_box`:
331
333
334
335
336
337
/// // No assumptions can be made about either number, so the multiplication is kept.
338
/// let y = black_box(5) * black_box(10);
339
0 commit comments