]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/slow_vector_initialization.stderr
Auto merge of #68717 - petrochenkov:stabexpat, r=varkor
[rust.git] / tests / ui / slow_vector_initialization.stderr
index ece6f388c84b762ba786cd3ce4c49c6afcb1bd76..5d2788ec2608632267ef559e10960515924136d6 100644 (file)
-error: detected slow zero-filling initialization
-  --> $DIR/slow_vector_initialization.rs:22:5
+error: slow zero-filling initialization
+  --> $DIR/slow_vector_initialization.rs:13:5
    |
-22 |     let mut vec1 = Vec::with_capacity(len);
-   |     ^^^^^^^^^^^^^^^-----------------------^
-   |                    |
-   |                    help: consider replacing with: `vec![0; ..]`
+LL |     let mut vec1 = Vec::with_capacity(len);
+   |                    ----------------------- help: consider replace allocation with: `vec![0; len]`
+LL |     vec1.extend(repeat(0).take(len));
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `-D clippy::slow-vector-initialization` implied by `-D warnings`
-note: extended at
-  --> $DIR/slow_vector_initialization.rs:23:5
-   |
-23 |     vec1.extend(repeat(0).take(len));
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: detected slow zero-filling initialization
-  --> $DIR/slow_vector_initialization.rs:26:5
-   |
-26 |     let mut vec2 = Vec::with_capacity(len - 10);
-   |     ^^^^^^^^^^^^^^^----------------------------^
-   |                    |
-   |                    help: consider replacing with: `vec![0; ..]`
-   |
-note: extended at
-  --> $DIR/slow_vector_initialization.rs:27:5
+error: slow zero-filling initialization
+  --> $DIR/slow_vector_initialization.rs:17:5
    |
-27 |     vec2.extend(repeat(0).take(len - 10));
+LL |     let mut vec2 = Vec::with_capacity(len - 10);
+   |                    ---------------------------- help: consider replace allocation with: `vec![0; len - 10]`
+LL |     vec2.extend(repeat(0).take(len - 10));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: detected slow zero-filling initialization
-  --> $DIR/slow_vector_initialization.rs:39:5
+error: slow zero-filling initialization
+  --> $DIR/slow_vector_initialization.rs:31:5
    |
-39 |     let mut resized_vec = Vec::with_capacity(30);
-   |     ^^^^^^^^^^^^^^^^^^^^^^----------------------^
-   |                           |
-   |                           help: consider replacing with: `vec![0; ..]`
-   |
-note: resized at
-  --> $DIR/slow_vector_initialization.rs:42:5
-   |
-42 |     resized_vec.resize(30, 0);
+LL |     let mut resized_vec = Vec::with_capacity(30);
+   |                           ---------------------- help: consider replace allocation with: `vec![0; 30]`
+LL |     resized_vec.resize(30, 0);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: detected slow zero-filling initialization
-  --> $DIR/slow_vector_initialization.rs:40:5
-   |
-40 |     let mut extend_vec = Vec::with_capacity(30);
-   |     ^^^^^^^^^^^^^^^^^^^^^----------------------^
-   |                          |
-   |                          help: consider replacing with: `vec![0; ..]`
+error: slow zero-filling initialization
+  --> $DIR/slow_vector_initialization.rs:34:5
    |
-note: extended at
-  --> $DIR/slow_vector_initialization.rs:44:5
-   |
-44 |     extend_vec.extend(repeat(0).take(30));
+LL |     let mut extend_vec = Vec::with_capacity(30);
+   |                          ---------------------- help: consider replace allocation with: `vec![0; 30]`
+LL |     extend_vec.extend(repeat(0).take(30));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: detected slow zero-filling initialization
-  --> $DIR/slow_vector_initialization.rs:50:5
-   |
-50 |     let mut vec1 = Vec::with_capacity(len);
-   |     ^^^^^^^^^^^^^^^-----------------------^
-   |                    |
-   |                    help: consider replacing with: `vec![0; ..]`
+error: slow zero-filling initialization
+  --> $DIR/slow_vector_initialization.rs:41:5
    |
-note: resized at
-  --> $DIR/slow_vector_initialization.rs:51:5
-   |
-51 |     vec1.resize(len, 0);
+LL |     let mut vec1 = Vec::with_capacity(len);
+   |                    ----------------------- help: consider replace allocation with: `vec![0; len]`
+LL |     vec1.resize(len, 0);
    |     ^^^^^^^^^^^^^^^^^^^
 
-error: detected slow zero-filling initialization
-  --> $DIR/slow_vector_initialization.rs:58:5
-   |
-58 |     let mut vec3 = Vec::with_capacity(len - 10);
-   |     ^^^^^^^^^^^^^^^----------------------------^
-   |                    |
-   |                    help: consider replacing with: `vec![0; ..]`
-   |
-note: resized at
-  --> $DIR/slow_vector_initialization.rs:59:5
+error: slow zero-filling initialization
+  --> $DIR/slow_vector_initialization.rs:49:5
    |
-59 |     vec3.resize(len - 10, 0);
+LL |     let mut vec3 = Vec::with_capacity(len - 10);
+   |                    ---------------------------- help: consider replace allocation with: `vec![0; len - 10]`
+LL |     vec3.resize(len - 10, 0);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: detected slow zero-filling initialization
-  --> $DIR/slow_vector_initialization.rs:62:5
-   |
-62 |     vec1 = Vec::with_capacity(10);
-   |     ^^^^^^^----------------------
-   |            |
-   |            help: consider replacing with: `vec![0; ..]`
-   |
-note: resized at
-  --> $DIR/slow_vector_initialization.rs:63:5
+error: slow zero-filling initialization
+  --> $DIR/slow_vector_initialization.rs:53:5
    |
-63 |     vec1.resize(10, 0);
+LL |     vec1 = Vec::with_capacity(10);
+   |            ---------------------- help: consider replace allocation with: `vec![0; 10]`
+LL |     vec1.resize(10, 0);
    |     ^^^^^^^^^^^^^^^^^^
 
-error: detected slow zero-filling initialization
-  --> $DIR/slow_vector_initialization.rs:67:5
-   |
-67 |     let mut unsafe_vec: Vec<u8> = Vec::with_capacity(200);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------------^
-   |                                   |
-   |                                   help: consider replacing with: `vec![0; ..]`
-   |
-note: changed len at
-  --> $DIR/slow_vector_initialization.rs:70:9
-   |
-70 |         unsafe_vec.set_len(200);
-   |         ^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 8 previous errors
+error: aborting due to 7 previous errors