]> git.lizzy.rs Git - rust.git/blob - tests/ui/vec_init_then_push.stderr
Auto merge of #9684 - kraktus:ref_option_ref, r=xFrednet
[rust.git] / tests / ui / vec_init_then_push.stderr
1 error: calls to `push` immediately after creation
2   --> $DIR/vec_init_then_push.rs:5:5
3    |
4 LL | /     let mut def_err: Vec<u32> = Default::default();
5 LL | |     def_err.push(0);
6    | |____________________^ help: consider using the `vec![]` macro: `let def_err: Vec<u32> = vec![..];`
7    |
8    = note: `-D clippy::vec-init-then-push` implied by `-D warnings`
9
10 error: calls to `push` immediately after creation
11   --> $DIR/vec_init_then_push.rs:8:5
12    |
13 LL | /     let mut new_err = Vec::<u32>::new();
14 LL | |     new_err.push(1);
15    | |____________________^ help: consider using the `vec![]` macro: `let mut new_err = vec![..];`
16
17 error: calls to `push` immediately after creation
18   --> $DIR/vec_init_then_push.rs:11:5
19    |
20 LL | /     let mut cap_err = Vec::with_capacity(2);
21 LL | |     cap_err.push(0);
22 LL | |     cap_err.push(1);
23 LL | |     cap_err.push(2);
24    | |____________________^ help: consider using the `vec![]` macro: `let mut cap_err = vec![..];`
25
26 error: calls to `push` immediately after creation
27   --> $DIR/vec_init_then_push.rs:23:5
28    |
29 LL | /     new_err = Vec::new();
30 LL | |     new_err.push(0);
31    | |____________________^ help: consider using the `vec![]` macro: `new_err = vec![..];`
32
33 error: calls to `push` immediately after creation
34   --> $DIR/vec_init_then_push.rs:73:5
35    |
36 LL | /     let mut v = Vec::new();
37 LL | |     v.push(x);
38 LL | |     v.push(1);
39    | |______________^ help: consider using the `vec![]` macro: `let mut v = vec![..];`
40
41 error: calls to `push` immediately after creation
42   --> $DIR/vec_init_then_push.rs:81:5
43    |
44 LL | /     let mut v = Vec::new();
45 LL | |     v.push(0);
46 LL | |     v.push(1);
47 LL | |     v.push(0);
48 ...  |
49 LL | |     v.push(1);
50 LL | |     v.push(0);
51    | |______________^ help: consider using the `vec![]` macro: `let mut v = vec![..];`
52
53 error: calls to `push` immediately after creation
54   --> $DIR/vec_init_then_push.rs:94:5
55    |
56 LL | /     let mut v2 = Vec::new();
57 LL | |     v2.push(0);
58 LL | |     v2.push(1);
59 LL | |     v2.push(0);
60 ...  |
61 LL | |     v2.push(1);
62 LL | |     v2.push(0);
63    | |_______________^ help: consider using the `vec![]` macro: `let mut v2 = vec![..];`
64
65 error: calls to `push` immediately after creation
66   --> $DIR/vec_init_then_push.rs:109:5
67    |
68 LL | /     let mut v = Vec::new();
69 LL | |     v.push((0i32, 0i32));
70    | |_________________________^ help: consider using the `vec![]` macro: `let v = vec![..];`
71
72 error: aborting due to 8 previous errors
73