]> git.lizzy.rs Git - rust.git/blob - tests/ui/serde.rs
Auto merge of #3635 - matthiaskrgr:revert_random_state_3603, r=xfix
[rust.git] / tests / ui / serde.rs
1 // Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
3 //
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
9
10 #![warn(clippy::serde_api_misuse)]
11 #![allow(dead_code)]
12
13 extern crate serde;
14
15 struct A;
16
17 impl<'de> serde::de::Visitor<'de> for A {
18     type Value = ();
19
20     fn expecting(&self, _: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
21         unimplemented!()
22     }
23
24     fn visit_str<E>(self, _v: &str) -> Result<Self::Value, E>
25     where
26         E: serde::de::Error,
27     {
28         unimplemented!()
29     }
30
31     fn visit_string<E>(self, _v: String) -> Result<Self::Value, E>
32     where
33         E: serde::de::Error,
34     {
35         unimplemented!()
36     }
37 }
38
39 struct B;
40
41 impl<'de> serde::de::Visitor<'de> for B {
42     type Value = ();
43
44     fn expecting(&self, _: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
45         unimplemented!()
46     }
47
48     fn visit_string<E>(self, _v: String) -> Result<Self::Value, E>
49     where
50         E: serde::de::Error,
51     {
52         unimplemented!()
53     }
54 }
55
56 fn main() {}