-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-langRelevant to the language teamRelevant to the language team
Description
Take this example code.
trait MyThing {
fn do_stuff(&self) -> bool;
fn do_other_stuff(&self) -> bool;
}
struct Other {}
impl MyThing for Other {
fn do_stuff(&self) -> bool {
true
}
fn do_other_stuff(&self) -> bool {
true
}
}
fn main() {
let thing = Other {};
thing.do_stuff();
// NOTE: We never call `do_other_stuff`.
}
Even though we never call do_other_stuff
, the compiler does not generate a warning that this trait method is unused. We've defined an implementation for it, but this doesn't mean that the method is used.
Apologies if this issue has already been raised.
EliSnow, Nemo157, david-mcgillicuddy-moixa, wdanilo, thomaseizinger and 30 more
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-langRelevant to the language teamRelevant to the language team