]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/write_with_newline.stderr
iterate List by value
[rust.git] / tests / ui / write_with_newline.stderr
index 7bb9b99731ffb7740a3753ac6c6c73be20174f0f..2473329ca7276e149eb6702d32ea76c87de995c6 100644 (file)
-error: using `write!()` with a format string that ends in a newline, consider using `writeln!()` instead
-  --> $DIR/write_with_newline.rs:10:5
+error: using `write!()` with a format string that ends in a single newline
+  --> $DIR/write_with_newline.rs:13:5
    |
-10 |     write!(&mut v, "Hello/n");
+LL |     write!(&mut v, "Hello/n");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: `-D write-with-newline` implied by `-D warnings`
+   = note: `-D clippy::write-with-newline` implied by `-D warnings`
+help: use `writeln!()` instead
+   |
+LL |     writeln!(&mut v, "Hello");
+   |     ^^^^^^^               --
 
-error: using `write!()` with a format string that ends in a newline, consider using `writeln!()` instead
-  --> $DIR/write_with_newline.rs:11:5
+error: using `write!()` with a format string that ends in a single newline
+  --> $DIR/write_with_newline.rs:14:5
    |
-11 |     write!(&mut v, "Hello {}/n", "world");
+LL |     write!(&mut v, "Hello {}/n", "world");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: use `writeln!()` instead
+   |
+LL |     writeln!(&mut v, "Hello {}", "world");
+   |     ^^^^^^^                  --
 
-error: using `write!()` with a format string that ends in a newline, consider using `writeln!()` instead
-  --> $DIR/write_with_newline.rs:12:5
+error: using `write!()` with a format string that ends in a single newline
+  --> $DIR/write_with_newline.rs:15:5
    |
-12 |     write!(&mut v, "Hello {} {}/n/n", "world", "#2");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     write!(&mut v, "Hello {} {}/n", "world", "#2");
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: use `writeln!()` instead
+   |
+LL |     writeln!(&mut v, "Hello {} {}", "world", "#2");
+   |     ^^^^^^^                     --
 
-error: using `write!()` with a format string that ends in a newline, consider using `writeln!()` instead
-  --> $DIR/write_with_newline.rs:13:5
+error: using `write!()` with a format string that ends in a single newline
+  --> $DIR/write_with_newline.rs:16:5
+   |
+LL |     write!(&mut v, "{}/n", 1265);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: use `writeln!()` instead
+   |
+LL |     writeln!(&mut v, "{}", 1265);
+   |     ^^^^^^^            --
+
+error: using `write!()` with a format string that ends in a single newline
+  --> $DIR/write_with_newline.rs:35:5
+   |
+LL |     write!(&mut v, "//n"); // should fail
+   |     ^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: use `writeln!()` instead
+   |
+LL |     writeln!(&mut v, "/"); // should fail
+   |     ^^^^^^^            --
+
+error: using `write!()` with a format string that ends in a single newline
+  --> $DIR/write_with_newline.rs:42:5
    |
-13 |     write!(&mut v, "{}/n", 1265);
+LL | /     write!(
+LL | |         &mut v,
+LL | |         "
+LL | | "
+LL | |     );
+   | |_____^
+   |
+help: use `writeln!()` instead
+   |
+LL |     writeln!(
+LL |         &mut v,
+LL |         ""
+   |
+
+error: using `write!()` with a format string that ends in a single newline
+  --> $DIR/write_with_newline.rs:47:5
+   |
+LL | /     write!(
+LL | |         &mut v,
+LL | |         r"
+LL | | "
+LL | |     );
+   | |_____^
+   |
+help: use `writeln!()` instead
+   |
+LL |     writeln!(
+LL |         &mut v,
+LL |         r""
+   |
+
+error: using `write!()` with a format string that ends in a single newline
+  --> $DIR/write_with_newline.rs:56:5
+   |
+LL |     write!(&mut v, "/r/n"); //~ ERROR
+   |     ^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: use `writeln!()` instead
+   |
+LL |     writeln!(&mut v, "/r"); //~ ERROR
+   |     ^^^^^^^             --
+
+error: using `write!()` with a format string that ends in a single newline
+  --> $DIR/write_with_newline.rs:57:5
+   |
+LL |     write!(&mut v, "foo/rbar/n");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: use `writeln!()` instead
+   |
+LL |     writeln!(&mut v, "foo/rbar");
+   |     ^^^^^^^                  --
 
-error: aborting due to 4 previous errors
+error: aborting due to 9 previous errors