about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/reserve_after_initialization.stderr
blob: e79b59a35d41859aef57b7d65f9a3310d3f72fa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
error: call to `reserve` immediately after creation
  --> tests/ui/reserve_after_initialization.rs:10:5
   |
LL | /     let mut v1: Vec<usize> = vec![];
LL | |
LL | |     v1.reserve(10);
   | |___________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut v1: Vec<usize> = Vec::with_capacity(10);`
   |
   = note: `-D clippy::reserve-after-initialization` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::reserve_after_initialization)]`

error: call to `reserve` immediately after creation
  --> tests/ui/reserve_after_initialization.rs:18:5
   |
LL | /     let mut v2: Vec<usize> = vec![];
LL | |
LL | |     v2.reserve(capacity);
   | |_________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut v2: Vec<usize> = Vec::with_capacity(capacity);`

error: call to `reserve` immediately after creation
  --> tests/ui/reserve_after_initialization.rs:37:5
   |
LL | /     v5 = Vec::new();
LL | |
LL | |     v5.reserve(10);
   | |___________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `v5 = Vec::with_capacity(10);`

error: aborting due to 3 previous errors