Files
rust/tests/incremental/lint-unused-features.rs
Zalathar 72abf370bb Rename incremental cfail/cpass revisions to bfail/bpass
Long ago, UI tests were divided into "compile" and "run" tests. Later, the
compile tests were further subdivided into "check" and "build" tests, to speed
up tests that don't need a full build.

The same split was never applied to incremental test revisions, so the only way
to perform a check build in incremental tests is (confusingly) to use a `cfail`
revision and then specify `//@ check-fail` or `//@ check-pass`.

This PR makes room for dedicated check-fail and check-pass revisions by
renaming the existing `cfail` and `cpass` revisions to `bfail` and `bpass`,
since they currently perform a full build.
2026-04-18 18:13:17 +10:00

42 lines
829 B
Rust

//@ revisions: rpass bfail
//@ ignore-backends: gcc
#![deny(unused_features)]
// Used language features
#![feature(box_patterns)]
#![feature(decl_macro)]
#![cfg_attr(all(), feature(rustc_attrs))]
// Used library features
#![feature(error_iter)]
//[bfail]~^ ERROR feature `error_iter` is declared but not used
#![cfg_attr(all(), feature(allocator_api))]
//[bfail]~^ ERROR feature `allocator_api` is declared but not used
pub fn use_box_patterns(b: Box<i32>) -> i32 {
let box x = b;
x
}
macro m() {}
pub fn use_decl_macro() {
m!();
}
#[rustc_dummy]
pub fn use_rustc_attrs() {}
#[cfg(rpass)]
pub fn use_error_iter(e: &(dyn std::error::Error + 'static)) {
for _ in e.sources() {}
}
#[cfg(rpass)]
pub fn use_allocator_api() {
use std::alloc::Global;
let _ = Vec::<i32>::new_in(Global);
}
fn main() {}