summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/vec_init_then_push.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/vec_init_then_push.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/vec_init_then_push.stderr')
-rw-r--r--src/tools/clippy/tests/ui/vec_init_then_push.stderr73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/vec_init_then_push.stderr b/src/tools/clippy/tests/ui/vec_init_then_push.stderr
new file mode 100644
index 000000000..a9da1c520
--- /dev/null
+++ b/src/tools/clippy/tests/ui/vec_init_then_push.stderr
@@ -0,0 +1,73 @@
+error: calls to `push` immediately after creation
+ --> $DIR/vec_init_then_push.rs:5:5
+ |
+LL | / let mut def_err: Vec<u32> = Default::default();
+LL | | def_err.push(0);
+ | |____________________^ help: consider using the `vec![]` macro: `let def_err: Vec<u32> = vec![..];`
+ |
+ = note: `-D clippy::vec-init-then-push` implied by `-D warnings`
+
+error: calls to `push` immediately after creation
+ --> $DIR/vec_init_then_push.rs:8:5
+ |
+LL | / let mut new_err = Vec::<u32>::new();
+LL | | new_err.push(1);
+ | |____________________^ help: consider using the `vec![]` macro: `let mut new_err = vec![..];`
+
+error: calls to `push` immediately after creation
+ --> $DIR/vec_init_then_push.rs:11:5
+ |
+LL | / let mut cap_err = Vec::with_capacity(2);
+LL | | cap_err.push(0);
+LL | | cap_err.push(1);
+LL | | cap_err.push(2);
+ | |____________________^ help: consider using the `vec![]` macro: `let mut cap_err = vec![..];`
+
+error: calls to `push` immediately after creation
+ --> $DIR/vec_init_then_push.rs:23:5
+ |
+LL | / new_err = Vec::new();
+LL | | new_err.push(0);
+ | |____________________^ help: consider using the `vec![]` macro: `new_err = vec![..];`
+
+error: calls to `push` immediately after creation
+ --> $DIR/vec_init_then_push.rs:73:5
+ |
+LL | / let mut v = Vec::new();
+LL | | v.push(x);
+LL | | v.push(1);
+ | |______________^ help: consider using the `vec![]` macro: `let mut v = vec![..];`
+
+error: calls to `push` immediately after creation
+ --> $DIR/vec_init_then_push.rs:81:5
+ |
+LL | / let mut v = Vec::new();
+LL | | v.push(0);
+LL | | v.push(1);
+LL | | v.push(0);
+... |
+LL | | v.push(1);
+LL | | v.push(0);
+ | |______________^ help: consider using the `vec![]` macro: `let mut v = vec![..];`
+
+error: calls to `push` immediately after creation
+ --> $DIR/vec_init_then_push.rs:94:5
+ |
+LL | / let mut v2 = Vec::new();
+LL | | v2.push(0);
+LL | | v2.push(1);
+LL | | v2.push(0);
+... |
+LL | | v2.push(1);
+LL | | v2.push(0);
+ | |_______________^ help: consider using the `vec![]` macro: `let mut v2 = vec![..];`
+
+error: calls to `push` immediately after creation
+ --> $DIR/vec_init_then_push.rs:109:5
+ |
+LL | / let mut v = Vec::new();
+LL | | v.push((0i32, 0i32));
+ | |_________________________^ help: consider using the `vec![]` macro: `let v = vec![..];`
+
+error: aborting due to 8 previous errors
+