Skip to content

Commit

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

`@rustbot` label +T-libs-api -T-libs
  • Loading branch information
JohnTitor authored Sep 28, 2022
2 parents 5abb4fe + 4184706 commit ecb3602
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion alloc/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#![feature(pointer_is_aligned)]
#![feature(slice_flatten)]
#![feature(thin_box)]
#![feature(bench_black_box)]
#![feature(strict_provenance)]
#![feature(once_cell)]
#![feature(drain_keep_rest)]
Expand Down
2 changes: 1 addition & 1 deletion core/src/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ pub fn spin_loop() {
///
/// [`std::convert::identity`]: crate::convert::identity
#[inline]
#[unstable(feature = "bench_black_box", issue = "64102")]
#[stable(feature = "bench_black_box", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_unstable(feature = "const_black_box", issue = "none")]
pub const fn black_box<T>(dummy: T) -> T {
crate::intrinsics::black_box(dummy)
Expand Down
1 change: 0 additions & 1 deletion core/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#![feature(array_chunks)]
#![feature(array_methods)]
#![feature(array_windows)]
#![feature(bench_black_box)]
#![feature(bigint_helper_methods)]
#![feature(cell_update)]
#![feature(const_assume)]
Expand Down
1 change: 0 additions & 1 deletion std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@
#![feature(trace_macros)]
//
// Only used in tests/benchmarks:
#![feature(bench_black_box)]
//
// Only for const-ness:
#![feature(const_io_structs)]
Expand Down
1 change: 0 additions & 1 deletion test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#![unstable(feature = "test", issue = "50297")]
#![doc(test(attr(deny(warnings))))]
#![feature(bench_black_box)]
#![feature(internal_output_capture)]
#![feature(staged_api)]
#![feature(process_exitcode_internals)]
Expand Down

0 comments on commit ecb3602

Please sign in to comment.