rust/tests/ui/reserve_after_initialization.stderr

19 lines
764 B
Plaintext
Raw Normal View History

error: calls to `reverse` immediately after creation
2023-08-21 16:36:15 -05:00
--> $DIR/reserve_after_initialization.rs:5:5
|
2023-08-21 16:36:15 -05:00
LL | / let mut v1: Vec<usize> = vec![];
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`
2023-08-21 16:36:15 -05:00
error: calls to `reverse` immediately after creation
--> $DIR/reserve_after_initialization.rs:10:5
|
LL | / let mut v2: Vec<usize> = vec![];
LL | | v2.reserve(capacity);
| |_________________________^ help: consider using `Vec::with_capacity(space_hint)`: `let mut v2: Vec<usize> = Vec::with_capacity(capacity);`
error: aborting due to 2 previous errors