Rollup merge of #102232 - Urgau:stabilize-bench_black_box, r=TaKO8Ki
Stabilize bench_black_box This PR stabilize `feature(bench_black_box)`. ```rust pub fn black_box<T>(dummy: T) -> T; ``` The FCP was completed in https://github.com/rust-lang/rust/issues/64102. `@rustbot` label +T-libs-api -T-libs
This commit is contained in:
commit
07bb2e6527
23 changed files with 8 additions and 28 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// Validation makes this fail in the wrong place
|
||||
// Make sure we find these even with many checks disabled.
|
||||
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
#![feature(bench_black_box)]
|
||||
|
||||
|
||||
fn main() {
|
||||
let b = unsafe { std::mem::transmute::<u8, bool>(2) };
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(stmt_expr_attributes, bench_black_box)]
|
||||
#![feature(stmt_expr_attributes)]
|
||||
#![allow(arithmetic_overflow)]
|
||||
use std::fmt::Debug;
|
||||
use std::hint::black_box;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
#![feature(bench_black_box)]
|
||||
use std::hint::black_box as b;
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue