summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/write_with_newline.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/tools/clippy/tests/ui/write_with_newline.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/write_with_newline.stderr')
-rw-r--r--src/tools/clippy/tests/ui/write_with_newline.stderr133
1 files changed, 133 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/write_with_newline.stderr b/src/tools/clippy/tests/ui/write_with_newline.stderr
new file mode 100644
index 000000000..5f55431be
--- /dev/null
+++ b/src/tools/clippy/tests/ui/write_with_newline.stderr
@@ -0,0 +1,133 @@
+error: using `write!()` with a format string that ends in a single newline
+ --> $DIR/write_with_newline.rs:13:5
+ |
+LL | write!(v, "Hello/n");
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `-D clippy::write-with-newline` implied by `-D warnings`
+help: use `writeln!()` instead
+ |
+LL - write!(v, "Hello/n");
+LL + writeln!(v, "Hello");
+ |
+
+error: using `write!()` with a format string that ends in a single newline
+ --> $DIR/write_with_newline.rs:14:5
+ |
+LL | write!(v, "Hello {}/n", "world");
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: use `writeln!()` instead
+ |
+LL - write!(v, "Hello {}/n", "world");
+LL + writeln!(v, "Hello {}", "world");
+ |
+
+error: using `write!()` with a format string that ends in a single newline
+ --> $DIR/write_with_newline.rs:15:5
+ |
+LL | write!(v, "Hello {} {}/n", "world", "#2");
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: use `writeln!()` instead
+ |
+LL - write!(v, "Hello {} {}/n", "world", "#2");
+LL + writeln!(v, "Hello {} {}", "world", "#2");
+ |
+
+error: using `write!()` with a format string that ends in a single newline
+ --> $DIR/write_with_newline.rs:16:5
+ |
+LL | write!(v, "{}/n", 1265);
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: use `writeln!()` instead
+ |
+LL - write!(v, "{}/n", 1265);
+LL + writeln!(v, "{}", 1265);
+ |
+
+error: using `write!()` with a format string that ends in a single newline
+ --> $DIR/write_with_newline.rs:17:5
+ |
+LL | write!(v, "/n");
+ | ^^^^^^^^^^^^^^^
+ |
+help: use `writeln!()` instead
+ |
+LL - write!(v, "/n");
+LL + writeln!(v);
+ |
+
+error: using `write!()` with a format string that ends in a single newline
+ --> $DIR/write_with_newline.rs:36:5
+ |
+LL | write!(v, "//n"); // should fail
+ | ^^^^^^^^^^^^^^^^^
+ |
+help: use `writeln!()` instead
+ |
+LL - write!(v, "//n"); // should fail
+LL + writeln!(v, "/"); // should fail
+ |
+
+error: using `write!()` with a format string that ends in a single newline
+ --> $DIR/write_with_newline.rs:43:5
+ |
+LL | / write!(
+LL | | v,
+LL | | "
+LL | | "
+LL | | );
+ | |_____^
+ |
+help: use `writeln!()` instead
+ |
+LL ~ writeln!(
+LL | v,
+LL ~ ""
+ |
+
+error: using `write!()` with a format string that ends in a single newline
+ --> $DIR/write_with_newline.rs:48:5
+ |
+LL | / write!(
+LL | | v,
+LL | | r"
+LL | | "
+LL | | );
+ | |_____^
+ |
+help: use `writeln!()` instead
+ |
+LL ~ writeln!(
+LL | v,
+LL ~ r""
+ |
+
+error: using `write!()` with a format string that ends in a single newline
+ --> $DIR/write_with_newline.rs:57:5
+ |
+LL | write!(v, "/r/n"); //~ ERROR
+ | ^^^^^^^^^^^^^^^^^^
+ |
+help: use `writeln!()` instead
+ |
+LL - write!(v, "/r/n"); //~ ERROR
+LL + writeln!(v, "/r"); //~ ERROR
+ |
+
+error: using `write!()` with a format string that ends in a single newline
+ --> $DIR/write_with_newline.rs:58:5
+ |
+LL | write!(v, "foo/rbar/n");
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: use `writeln!()` instead
+ |
+LL - write!(v, "foo/rbar/n");
+LL + writeln!(v, "foo/rbar");
+ |
+
+error: aborting due to 10 previous errors
+