Skip to content

Commit 91578c0

Browse files
authored
Rollup merge of rust-lang#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 rust-lang#64102. `@rustbot` label +T-libs-api -T-libs
2 parents bde14a3 + aca404a commit 91578c0

File tree

23 files changed

+7
-27
lines changed

23 files changed

+7
-27
lines changed

compiler/rustc_codegen_cranelift/example/std_example.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(core_intrinsics, generators, generator_trait, is_sorted, bench_black_box)]
1+
#![feature(core_intrinsics, generators, generator_trait, is_sorted)]
22

33
#[cfg(target_arch = "x86_64")]
44
use std::arch::x86_64::*;

compiler/rustc_codegen_gcc/tests/run/int.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Run-time:
44
// status: 0
55

6-
#![feature(bench_black_box, const_black_box, core_intrinsics, start)]
6+
#![feature(const_black_box, core_intrinsics, start)]
77

88
#![no_std]
99

compiler/rustc_index/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![deny(rustc::untranslatable_diagnostic)]
22
#![deny(rustc::diagnostic_outside_of_impl)]
33
#![feature(allow_internal_unstable)]
4-
#![feature(bench_black_box)]
54
#![feature(extend_one)]
65
#![feature(min_specialization)]
76
#![feature(new_uninit)]

library/alloc/tests/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#![feature(pointer_is_aligned)]
4242
#![feature(slice_flatten)]
4343
#![feature(thin_box)]
44-
#![feature(bench_black_box)]
4544
#![feature(strict_provenance)]
4645
#![feature(once_cell)]
4746
#![feature(drain_keep_rest)]

library/core/src/hint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ pub fn spin_loop() {
217217
///
218218
/// [`std::convert::identity`]: crate::convert::identity
219219
#[inline]
220-
#[unstable(feature = "bench_black_box", issue = "64102")]
220+
#[stable(feature = "bench_black_box", since = "CURRENT_RUSTC_VERSION")]
221221
#[rustc_const_unstable(feature = "const_black_box", issue = "none")]
222222
pub const fn black_box<T>(dummy: T) -> T {
223223
crate::intrinsics::black_box(dummy)

library/core/tests/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#![feature(array_chunks)]
33
#![feature(array_methods)]
44
#![feature(array_windows)]
5-
#![feature(bench_black_box)]
65
#![feature(bigint_helper_methods)]
76
#![feature(cell_update)]
87
#![feature(const_assume)]

library/std/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@
348348
#![feature(trace_macros)]
349349
//
350350
// Only used in tests/benchmarks:
351-
#![feature(bench_black_box)]
352351
//
353352
// Only for const-ness:
354353
#![feature(const_io_structs)]

library/test/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
#![unstable(feature = "test", issue = "50297")]
1717
#![doc(test(attr(deny(warnings))))]
18-
#![feature(bench_black_box)]
1918
#![feature(internal_output_capture)]
2019
#![feature(staged_api)]
2120
#![feature(process_exitcode_internals)]

src/test/incremental/spans_significant_w_panic.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// compile-flags: -C overflow-checks=on -Z query-dep-graph
99

1010
#![feature(rustc_attrs)]
11-
#![feature(bench_black_box)]
1211
#![rustc_partition_codegened(module = "spans_significant_w_panic", cfg = "rpass2")]
1312
#![rustc_partition_codegened(module = "spans_significant_w_panic", cfg = "rpass4")]
1413

src/test/ui/box/issue-95036.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// compile-flags: -O
22
// build-pass
33

4-
#![feature(allocator_api, bench_black_box)]
4+
#![feature(allocator_api)]
55

66
#[inline(never)]
77
pub fn by_ref(node: &mut Box<[u8; 1], &std::alloc::Global>) {

0 commit comments

Comments
 (0)