rust/tests/ui/lint/dead-code/issue-41883.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
590 B
Rust
Raw Normal View History

#![deny(dead_code)]
enum Category {
Dead, //~ ERROR variant `Dead` is never constructed
Used,
}
trait UnusedTrait { //~ ERROR trait `UnusedTrait` is never used
fn this_is_unused(&self) -> Category {
Category::Dead
}
}
struct UnusedStruct; //~ ERROR struct `UnusedStruct` is never constructed
impl UnusedTrait for UnusedStruct {
fn this_is_unused(&self) -> Category {
Category::Used
}
}
mod private {
#[derive(Debug)]
struct UnusedStruct; //~ ERROR struct `UnusedStruct` is never constructed
}
fn main() {
let _c = Category::Used;
}