rust/tests/ui/serde.rs

48 lines
894 B
Rust
Raw Normal View History

2018-07-28 17:34:52 +02:00
#![warn(clippy::serde_api_misuse)]
#![allow(dead_code)]
extern crate serde;
struct A;
2017-05-09 15:23:10 +02:00
impl<'de> serde::de::Visitor<'de> for A {
type Value = ();
fn expecting(&self, _: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
unimplemented!()
}
fn visit_str<E>(self, _v: &str) -> Result<Self::Value, E>
2018-12-09 23:26:16 +01:00
where
E: serde::de::Error,
{
unimplemented!()
}
fn visit_string<E>(self, _v: String) -> Result<Self::Value, E>
2018-12-09 23:26:16 +01:00
where
E: serde::de::Error,
{
unimplemented!()
}
}
struct B;
2017-05-09 15:23:10 +02:00
impl<'de> serde::de::Visitor<'de> for B {
type Value = ();
fn expecting(&self, _: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
unimplemented!()
}
fn visit_string<E>(self, _v: String) -> Result<Self::Value, E>
2018-12-09 23:26:16 +01:00
where
E: serde::de::Error,
{
unimplemented!()
}
}
2018-12-09 23:26:16 +01:00
fn main() {}