@@ -9,14 +9,19 @@ struct A;
9
9
10
10
impl serde:: de:: Visitor for A {
11
11
type Value = ( ) ;
12
- fn visit_str < E > ( & mut self , _v : & str ) -> Result < Self :: Value , E >
13
- where E : serde:: Error ,
12
+
13
+ fn expecting ( & self , _: & mut :: std:: fmt:: Formatter ) -> :: std:: fmt:: Result {
14
+ unimplemented ! ( )
15
+ }
16
+
17
+ fn visit_str < E > ( self , _v : & str ) -> Result < Self :: Value , E >
18
+ where E : serde:: de:: Error ,
14
19
{
15
20
unimplemented ! ( )
16
21
}
17
22
18
- fn visit_string < E > ( & mut self , _v : String ) -> Result < Self :: Value , E >
19
- where E : serde:: Error ,
23
+ fn visit_string < E > ( self , _v : String ) -> Result < Self :: Value , E >
24
+ where E : serde:: de :: Error ,
20
25
{
21
26
unimplemented ! ( )
22
27
}
@@ -27,9 +32,13 @@ struct B;
27
32
impl serde:: de:: Visitor for B {
28
33
type Value = ( ) ;
29
34
30
- fn visit_string < E > ( & mut self , _v : String ) -> Result < Self :: Value , E >
35
+ fn expecting ( & self , _: & mut :: std:: fmt:: Formatter ) -> :: std:: fmt:: Result {
36
+ unimplemented ! ( )
37
+ }
38
+
39
+ fn visit_string < E > ( self , _v : String ) -> Result < Self :: Value , E >
31
40
//~^ ERROR you should not implement `visit_string` without also implementing `visit_str`
32
- where E : serde:: Error ,
41
+ where E : serde:: de :: Error ,
33
42
{
34
43
unimplemented ! ( )
35
44
}
0 commit comments