rust/tests/ui/for_loop.stderr

297 lines
9.1 KiB
Plaintext
Raw Normal View History

error: the loop variable `i` is only used to index `vec`.
--> $DIR/for_loop.rs:41:14
|
2018-12-27 09:57:55 -06:00
LL | for i in 0..vec.len() {
2018-01-28 22:18:11 -06:00
| ^^^^^^^^^^^^
|
= note: `-D clippy::needless-range-loop` implied by `-D warnings`
help: consider using an iterator
2017-07-10 08:29:29 -05:00
|
2018-12-27 09:57:55 -06:00
LL | for <item> in &vec {
2018-05-29 03:56:58 -05:00
| ^^^^^^ ^^^^
error: the loop variable `i` is only used to index `vec`.
--> $DIR/for_loop.rs:50:14
|
2018-12-27 09:57:55 -06:00
LL | for i in 0..vec.len() {
| ^^^^^^^^^^^^
help: consider using an iterator
|
2018-12-27 09:57:55 -06:00
LL | for <item> in &vec {
| ^^^^^^ ^^^^
error: the loop variable `j` is only used to index `STATIC`.
--> $DIR/for_loop.rs:55:14
|
2018-12-27 09:57:55 -06:00
LL | for j in 0..4 {
| ^^^^
help: consider using an iterator
|
2018-12-27 09:57:55 -06:00
LL | for <item> in &STATIC {
| ^^^^^^ ^^^^^^^
error: the loop variable `j` is only used to index `CONST`.
--> $DIR/for_loop.rs:59:14
|
2018-12-27 09:57:55 -06:00
LL | for j in 0..4 {
| ^^^^
help: consider using an iterator
|
2018-12-27 09:57:55 -06:00
LL | for <item> in &CONST {
| ^^^^^^ ^^^^^^
error: the loop variable `i` is used to index `vec`
--> $DIR/for_loop.rs:63:14
|
2018-12-27 09:57:55 -06:00
LL | for i in 0..vec.len() {
| ^^^^^^^^^^^^
help: consider using an iterator
|
2018-12-27 09:57:55 -06:00
LL | for (i, <item>) in vec.iter().enumerate() {
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec2`.
--> $DIR/for_loop.rs:71:14
|
2018-12-27 09:57:55 -06:00
LL | for i in 0..vec.len() {
| ^^^^^^^^^^^^
help: consider using an iterator
|
2018-12-27 09:57:55 -06:00
LL | for <item> in vec2.iter().take(vec.len()) {
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
--> $DIR/for_loop.rs:75:14
|
2018-12-27 09:57:55 -06:00
LL | for i in 5..vec.len() {
| ^^^^^^^^^^^^
help: consider using an iterator
|
2018-12-27 09:57:55 -06:00
LL | for <item> in vec.iter().skip(5) {
| ^^^^^^ ^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
--> $DIR/for_loop.rs:79:14
|
2018-12-27 09:57:55 -06:00
LL | for i in 0..MAX_LEN {
| ^^^^^^^^^^
help: consider using an iterator
|
2018-12-27 09:57:55 -06:00
LL | for <item> in vec.iter().take(MAX_LEN) {
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
--> $DIR/for_loop.rs:83:14
|
2018-12-27 09:57:55 -06:00
LL | for i in 0..=MAX_LEN {
| ^^^^^^^^^^^
help: consider using an iterator
|
2018-12-27 09:57:55 -06:00
LL | for <item> in vec.iter().take(MAX_LEN + 1) {
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
--> $DIR/for_loop.rs:87:14
|
2018-12-27 09:57:55 -06:00
LL | for i in 5..10 {
| ^^^^^
help: consider using an iterator
|
2018-12-27 09:57:55 -06:00
LL | for <item> in vec.iter().take(10).skip(5) {
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
--> $DIR/for_loop.rs:91:14
2018-12-27 09:57:55 -06:00
|
LL | for i in 5..=10 {
| ^^^^^^
help: consider using an iterator
2018-12-27 09:57:55 -06:00
|
LL | for <item> in vec.iter().take(10 + 1).skip(5) {
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is used to index `vec`
--> $DIR/for_loop.rs:95:14
2018-12-27 09:57:55 -06:00
|
LL | for i in 5..vec.len() {
| ^^^^^^^^^^^^
help: consider using an iterator
2018-12-27 09:57:55 -06:00
|
LL | for (i, <item>) in vec.iter().enumerate().skip(5) {
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is used to index `vec`
--> $DIR/for_loop.rs:99:14
2018-12-27 09:57:55 -06:00
|
LL | for i in 5..10 {
| ^^^^^
help: consider using an iterator
2018-12-27 09:57:55 -06:00
|
LL | for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
--> $DIR/for_loop.rs:103:14
2018-12-27 09:57:55 -06:00
|
LL | for i in 10..0 {
| ^^^^^
|
= note: `-D clippy::reverse-range-loop` implied by `-D warnings`
help: consider using the following if you are attempting to iterate over this range in reverse
2018-12-27 09:57:55 -06:00
|
LL | for i in (0..10).rev() {
| ^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
--> $DIR/for_loop.rs:107:14
2018-12-27 09:57:55 -06:00
|
LL | for i in 10..=0 {
| ^^^^^^
help: consider using the following if you are attempting to iterate over this range in reverse
2018-12-27 09:57:55 -06:00
|
LL | for i in (0...10).rev() {
| ^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
--> $DIR/for_loop.rs:111:14
2018-12-27 09:57:55 -06:00
|
LL | for i in MAX_LEN..0 {
| ^^^^^^^^^^
help: consider using the following if you are attempting to iterate over this range in reverse
2018-12-27 09:57:55 -06:00
|
LL | for i in (0..MAX_LEN).rev() {
| ^^^^^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
--> $DIR/for_loop.rs:115:14
2018-12-27 09:57:55 -06:00
|
LL | for i in 5..5 {
| ^^^^
error: this range is empty so this for loop will never run
--> $DIR/for_loop.rs:140:14
2018-12-27 09:57:55 -06:00
|
LL | for i in 10..5 + 4 {
| ^^^^^^^^^
help: consider using the following if you are attempting to iterate over this range in reverse
2018-12-27 09:57:55 -06:00
|
LL | for i in (5 + 4..10).rev() {
| ^^^^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
--> $DIR/for_loop.rs:144:14
2018-12-27 09:57:55 -06:00
|
LL | for i in (5 + 2)..(3 - 1) {
| ^^^^^^^^^^^^^^^^
help: consider using the following if you are attempting to iterate over this range in reverse
2018-12-27 09:57:55 -06:00
|
LL | for i in ((3 - 1)..(5 + 2)).rev() {
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
--> $DIR/for_loop.rs:148:14
2018-12-27 09:57:55 -06:00
|
LL | for i in (5 + 2)..(8 - 1) {
| ^^^^^^^^^^^^^^^^
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:170:15
2018-12-27 09:57:55 -06:00
|
LL | for _v in vec.iter() {}
2019-03-26 04:55:03 -05:00
| ^^^^^^^^^^
2018-12-27 09:57:55 -06:00
|
= note: `-D clippy::explicit-iter-loop` implied by `-D warnings`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:172:15
2018-12-27 09:57:55 -06:00
|
LL | for _v in vec.iter_mut() {}
2019-03-26 04:55:03 -05:00
| ^^^^^^^^^^^^^^
error: it is more concise to loop over containers instead of using explicit iteration methods`
--> $DIR/for_loop.rs:175:15
2018-12-27 09:57:55 -06:00
|
LL | for _v in out_vec.into_iter() {}
2019-03-26 04:55:03 -05:00
| ^^^^^^^^^^^^^^^^^^^
2018-12-27 09:57:55 -06:00
|
= note: `-D clippy::explicit-into-iter-loop` implied by `-D warnings`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:178:15
2018-12-27 09:57:55 -06:00
|
LL | for _v in array.into_iter() {}
2019-03-26 04:55:03 -05:00
| ^^^^^^^^^^^^^^^^^
2017-02-21 05:13:44 -06:00
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:183:15
2018-12-27 09:57:55 -06:00
|
LL | for _v in [1, 2, 3].iter() {}
2019-03-26 04:55:03 -05:00
| ^^^^^^^^^^^^^^^^
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:187:15
2018-12-27 09:57:55 -06:00
|
LL | for _v in [0; 32].iter() {}
2019-03-26 04:55:03 -05:00
| ^^^^^^^^^^^^^^
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:192:15
2018-12-27 09:57:55 -06:00
|
LL | for _v in ll.iter() {}
2019-03-26 04:55:03 -05:00
| ^^^^^^^^^
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:195:15
2018-12-27 09:57:55 -06:00
|
LL | for _v in vd.iter() {}
2019-03-26 04:55:03 -05:00
| ^^^^^^^^^
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:198:15
2018-12-27 09:57:55 -06:00
|
LL | for _v in bh.iter() {}
2019-03-26 04:55:03 -05:00
| ^^^^^^^^^
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:201:15
2018-12-27 09:57:55 -06:00
|
LL | for _v in hm.iter() {}
2019-03-26 04:55:03 -05:00
| ^^^^^^^^^
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:204:15
2018-12-27 09:57:55 -06:00
|
LL | for _v in bt.iter() {}
2019-03-26 04:55:03 -05:00
| ^^^^^^^^^
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:207:15
2018-12-27 09:57:55 -06:00
|
LL | for _v in hs.iter() {}
2019-03-26 04:55:03 -05:00
| ^^^^^^^^^
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/for_loop.rs:210:15
2018-12-27 09:57:55 -06:00
|
LL | for _v in bs.iter() {}
2019-03-26 04:55:03 -05:00
| ^^^^^^^^^
error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
--> $DIR/for_loop.rs:212:15
2018-12-27 09:57:55 -06:00
|
LL | for _v in vec.iter().next() {}
| ^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::iter-next-loop` implied by `-D warnings`
error: you are collect()ing an iterator and throwing away the result. Consider using an explicit for loop to exhaust the iterator
--> $DIR/for_loop.rs:219:5
2018-12-27 09:57:55 -06:00
|
LL | vec.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::unused-collect` implied by `-D warnings`
error: aborting due to 35 previous errors
2018-01-16 10:06:27 -06:00