rust/tests/ui/lint/dead-code/allow-or-expect-dead_code-114557.rs
2024-06-25 17:22:22 +02:00

18 lines
334 B
Rust

//@ check-pass
//@ revisions: allow expect
// this test checks that no matter if we put #[allow(dead_code)]
// or #[expect(dead_code)], no warning is being emited
#![warn(dead_code)] // to override compiletest
fn f() {}
#[cfg_attr(allow, allow(dead_code))]
#[cfg_attr(expect, expect(dead_code))]
fn g() {
f();
}
fn main() {}