]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/explicit_write.rs
iterate List by value
[rust.git] / tests / ui / explicit_write.rs
index 10a4bca9f492fcd177e64921b46461816f49d6b8..455c5ef55d05c4209be525017565edc7706f26be 100644 (file)
@@ -1,12 +1,5 @@
-// 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.
-
+// run-rustfix
+#![allow(unused_imports)]
 #![warn(clippy::explicit_write)]
 
 fn stdout() -> String {
@@ -27,6 +20,10 @@ fn main() {
         writeln!(std::io::stderr(), "test").unwrap();
         std::io::stdout().write_fmt(format_args!("test")).unwrap();
         std::io::stderr().write_fmt(format_args!("test")).unwrap();
+
+        // including newlines
+        writeln!(std::io::stdout(), "test\ntest").unwrap();
+        writeln!(std::io::stderr(), "test\ntest").unwrap();
     }
     // these should not warn, different destination
     {