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:
Yuki Okushi 2022-09-28 13:07:17 +09:00 committed by GitHub
commit 07bb2e6527
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 8 additions and 28 deletions

View file

@ -8,7 +8,6 @@
// compile-flags: -C overflow-checks=on -Z query-dep-graph
#![feature(rustc_attrs)]
#![feature(bench_black_box)]
#![rustc_partition_codegened(module = "spans_significant_w_panic", cfg = "rpass2")]
#![rustc_partition_codegened(module = "spans_significant_w_panic", cfg = "rpass4")]

View file

@ -1,7 +1,7 @@
// compile-flags: -O
// build-pass
#![feature(allocator_api, bench_black_box)]
#![feature(allocator_api)]
#[inline(never)]
pub fn by_ref(node: &mut Box<[u8; 1], &std::alloc::Global>) {

View file

@ -1,6 +1,5 @@
// run-pass
// Test a ZST enum whose dicriminant is ~0i128. This caused an ICE when casting to an i32.
#![feature(bench_black_box)]
use std::hint::black_box;
#[derive(Copy, Clone)]

View file

@ -1,6 +1,5 @@
// run-pass
#![feature(const_discriminant)]
#![feature(bench_black_box)]
#![allow(dead_code)]
use std::mem::{discriminant, Discriminant};

View file

@ -1,5 +1,5 @@
// run-pass
#![feature(bench_black_box)]
use std::hint;
struct U16(u16);

View file

@ -4,8 +4,6 @@
// needs-unwind
// only-linux
#![feature(bench_black_box)]
use std::hint::black_box;
use std::mem::forget;
use std::panic::catch_unwind;

View file

@ -7,7 +7,6 @@
// ignore-sgx no processes
// ignore-android: FIXME(#85261)
#![feature(bench_black_box)]
#![feature(rustc_private)]
#![feature(never_type)]
#![feature(panic_always_abort)]

View file

@ -5,9 +5,7 @@
//
// run-fail
// error-pattern: AddressSanitizer: stack-buffer-overflow
// error-pattern: 'xs' (line 15) <== Memory access at offset
#![feature(bench_black_box)]
// error-pattern: 'xs' (line 13) <== Memory access at offset
use std::hint::black_box;

View file

@ -10,8 +10,6 @@
// run-fail
// error-pattern: HWAddressSanitizer: tag-mismatch
#![feature(bench_black_box)]
use std::hint::black_box;
fn main() {

View file

@ -6,8 +6,6 @@
// run-fail
// error-pattern: LeakSanitizer: detected memory leaks
#![feature(bench_black_box)]
use std::hint::black_box;
use std::mem;

View file

@ -17,7 +17,6 @@
#![feature(core_intrinsics)]
#![feature(start)]
#![feature(bench_black_box)]
use std::hint::black_box;
use std::mem::MaybeUninit;

View file

@ -16,7 +16,6 @@
#![feature(core_intrinsics)]
#![feature(start)]
#![feature(bench_black_box)]
#![allow(invalid_value)]
use std::hint::black_box;