]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/serde.rs
Auto merge of #3603 - xfix:random-state-lint, r=phansch
[rust.git] / tests / ui / serde.rs
index 78aabf352bb05ae1de23074e9e0be9419dfb5982..c52fd065dbef5093290c9014dae22b7bb8c1567c 100644 (file)
@@ -1,13 +1,20 @@
-#![feature(plugin)]
-#![plugin(clippy)]
-#![deny(serde_api_misuse)]
+// 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.
+
+#![warn(clippy::serde_api_misuse)]
 #![allow(dead_code)]
 
 extern crate serde;
 
 struct A;
 
-impl serde::de::Visitor for A {
+impl<'de> serde::de::Visitor<'de> for A {
     type Value = ();
 
     fn expecting(&self, _: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
@@ -15,13 +22,15 @@ fn expecting(&self, _: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
     }
 
     fn visit_str<E>(self, _v: &str) -> Result<Self::Value, E>
-        where E: serde::de::Error,
+    where
+        E: serde::de::Error,
     {
         unimplemented!()
     }
 
     fn visit_string<E>(self, _v: String) -> Result<Self::Value, E>
-        where E: serde::de::Error,
+    where
+        E: serde::de::Error,
     {
         unimplemented!()
     }
@@ -29,7 +38,7 @@ fn visit_string<E>(self, _v: String) -> Result<Self::Value, E>
 
 struct B;
 
-impl serde::de::Visitor for B {
+impl<'de> serde::de::Visitor<'de> for B {
     type Value = ();
 
     fn expecting(&self, _: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
@@ -37,12 +46,11 @@ fn expecting(&self, _: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
     }
 
     fn visit_string<E>(self, _v: String) -> Result<Self::Value, E>
-
-        where E: serde::de::Error,
+    where
+        E: serde::de::Error,
     {
         unimplemented!()
     }
 }
 
-fn main() {
-}
+fn main() {}