mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
30 lines
590 B
Rust
30 lines
590 B
Rust
#![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;
|
|
}
|