2018-10-06 11:18:06 -05:00
|
|
|
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2018-07-28 10:34:52 -05:00
|
|
|
#![warn(clippy::serde_api_misuse)]
|
2016-07-12 10:36:11 -05:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
extern crate serde;
|
|
|
|
|
|
|
|
struct A;
|
|
|
|
|
2017-05-09 08:23:10 -05:00
|
|
|
impl<'de> serde::de::Visitor<'de> for A {
|
2016-07-12 10:36:11 -05:00
|
|
|
type Value = ();
|
2017-01-24 04:31:42 -06:00
|
|
|
|
|
|
|
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 16:26:16 -06:00
|
|
|
where
|
|
|
|
E: serde::de::Error,
|
2016-07-12 10:36:11 -05:00
|
|
|
{
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
|
2017-01-24 04:31:42 -06:00
|
|
|
fn visit_string<E>(self, _v: String) -> Result<Self::Value, E>
|
2018-12-09 16:26:16 -06:00
|
|
|
where
|
|
|
|
E: serde::de::Error,
|
2016-07-12 10:36:11 -05:00
|
|
|
{
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct B;
|
|
|
|
|
2017-05-09 08:23:10 -05:00
|
|
|
impl<'de> serde::de::Visitor<'de> for B {
|
2016-07-12 10:36:11 -05:00
|
|
|
type Value = ();
|
|
|
|
|
2017-01-24 04:31:42 -06:00
|
|
|
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 16:26:16 -06:00
|
|
|
where
|
|
|
|
E: serde::de::Error,
|
2016-07-12 10:36:11 -05:00
|
|
|
{
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-09 16:26:16 -06:00
|
|
|
fn main() {}
|