rust/tests/ui/lint/dead-code/unused-assoc-fns.rs
Ezra Shaw 03cf0e949f
refactor: emit "unused assoc fn" in lexical order
with repect to other dead code lints
2023-04-13 20:53:32 +12:00

28 lines
432 B
Rust

#![deny(unused)]
struct Foo;
impl Foo {
fn one() {}
//~^ ERROR associated function `one` is never used [dead_code]
fn two(&self) {}
//~^ ERROR method `two` is never used [dead_code]
// seperation between functions
// ...
// ...
fn used() {}
fn three(&self) {
//~^ ERROR method `three` is never used [dead_code]
Foo::one();
// ...
}
}
fn main() {
Foo::used();
}