2022-10-17 16:59:27 -05:00
|
|
|
#![allow(unused, clippy::needless_lifetimes)]
|
|
|
|
#![warn(clippy::missing_trait_methods)]
|
|
|
|
|
|
|
|
trait A {
|
|
|
|
fn provided() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
trait B {
|
|
|
|
fn required();
|
|
|
|
|
|
|
|
fn a(_: usize) -> usize {
|
|
|
|
1
|
|
|
|
}
|
|
|
|
|
|
|
|
fn b<'a, T: AsRef<[u8]>>(a: &'a T) -> &'a [u8] {
|
|
|
|
a.as_ref()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Partial;
|
|
|
|
|
|
|
|
impl A for Partial {}
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: missing trait method provided by default: `provided`
|
2022-10-17 16:59:27 -05:00
|
|
|
|
|
|
|
impl B for Partial {
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: missing trait method provided by default: `b`
|
2022-10-17 16:59:27 -05:00
|
|
|
fn required() {}
|
|
|
|
|
|
|
|
fn a(_: usize) -> usize {
|
|
|
|
2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Complete;
|
|
|
|
|
|
|
|
impl A for Complete {
|
|
|
|
fn provided() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl B for Complete {
|
|
|
|
fn required() {}
|
|
|
|
|
|
|
|
fn a(_: usize) -> usize {
|
|
|
|
2
|
|
|
|
}
|
|
|
|
|
|
|
|
fn b<T: AsRef<[u8]>>(a: &T) -> &[u8] {
|
|
|
|
a.as_ref()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-07-25 15:13:55 -05:00
|
|
|
trait MissingMultiple {
|
|
|
|
fn one() {}
|
|
|
|
fn two() {}
|
|
|
|
fn three() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl MissingMultiple for Partial {}
|
|
|
|
|
2022-10-17 16:59:27 -05:00
|
|
|
fn main() {}
|