blob: 1b09b717ff70aed34e9d56545eeaf9923017846a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#![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 {}
//~^ ERROR: missing trait method provided by default: `provided`
impl B for Partial {
//~^ ERROR: missing trait method provided by default: `b`
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()
}
}
fn main() {}
|