Skip to content

Commit

Permalink
Rollup merge of rust-lang#102232 - Urgau:stabilize-bench_black_box, r…
Browse files Browse the repository at this point in the history
…=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 rust-lang#64102.

`@rustbot` label +T-libs-api -T-libs
  • Loading branch information
JohnTitor authored Sep 28, 2022
2 parents 6784b45 + 5269806 commit 985cc02
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/fail/invalid_bool.rs
Original file line number Diff line number Diff line change
@@ -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) };
Expand Down
2 changes: 1 addition & 1 deletion tests/pass/float.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 0 additions & 1 deletion tests/pass/u128.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(bench_black_box)]
use std::hint::black_box as b;

fn main() {
Expand Down

0 comments on commit 985cc02

Please sign in to comment.