rust/tests/ui/reserve_after_initialization.stderr

26 lines
1.0 KiB
Plaintext
Raw Normal View History

2023-08-22 11:46:16 -05:00
error: call to `reserve` immediately after creation
2023-08-22 12:36:58 -05:00
--> $DIR/reserve_after_initialization.rs:10:5
|
2023-08-21 16:36:15 -05:00
LL | / let mut v1: Vec<usize> = vec![];
LL | | v1.reserve(10);
2023-08-22 11:46:16 -05:00
| |___________________^ 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`
2023-08-22 11:46:16 -05:00
error: call to `reserve` immediately after creation
2023-08-22 12:36:58 -05:00
--> $DIR/reserve_after_initialization.rs:17:5
2023-08-21 16:36:15 -05:00
|
LL | / let mut v2: Vec<usize> = vec![];
LL | | v2.reserve(capacity);
2023-08-22 11:46:16 -05:00
| |_________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut v2: Vec<usize> = Vec::with_capacity(capacity);`
2023-08-21 16:36:15 -05:00
2023-08-22 11:46:16 -05:00
error: call to `reserve` immediately after creation
2023-08-22 12:36:58 -05:00
--> $DIR/reserve_after_initialization.rs:35:5
2023-08-22 11:46:16 -05:00
|
LL | / v5 = Vec::new();
LL | | v5.reserve(10);
| |___________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `v5 = Vec::with_capacity(10);`
error: aborting due to 3 previous errors