Files
rust/tests/ui/lint/dead-code/allow-or-expect-dead_code-114557-2.rs
T
tcpdumppy 69aafd21f5 tests: fix some typos in comment
Signed-off-by: tcpdumppy <847462026@qq.com>
2025-03-07 10:50:31 +08:00

19 lines
471 B
Rust

//@ check-pass
// this test checks that the `dead_code` lint is *NOT* being emitted
// for `foo` as `foo` is being used by `main`, and so the `#[expect]`
// is unfulfilled
//
// it also checks that the `dead_code` lint is also *NOT* emitted
// for `bar` as it's suppresed by the `#[expect]` on `bar`
#![warn(dead_code)] // to override compiletest
fn bar() {}
#[expect(dead_code)]
//~^ WARN this lint expectation is unfulfilled
fn foo() { bar() }
fn main() { foo() }