2017-02-07 21:05:30 +01:00
|
|
|
error: for loop over `option`, which is an `Option`. This is more readably written as an `if let` statement.
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:17:14
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 13:15:10 +02:00
|
|
|
17 | for x in option {
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
2017-05-17 14:19:44 +02:00
|
|
|
= note: `-D for-loop-over-option` implied by `-D warnings`
|
2017-02-07 21:05:30 +01:00
|
|
|
= help: consider replacing `for x in option` with `if let Some(x) = option`
|
|
|
|
|
|
|
|
error: for loop over `result`, which is a `Result`. This is more readably written as an `if let` statement.
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:22:14
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 13:15:10 +02:00
|
|
|
22 | for x in result {
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
2017-05-17 14:19:44 +02:00
|
|
|
= note: `-D for-loop-over-result` implied by `-D warnings`
|
2017-02-07 21:05:30 +01:00
|
|
|
= help: consider replacing `for x in result` with `if let Ok(x) = result`
|
|
|
|
|
|
|
|
error: for loop over `option.ok_or("x not found")`, which is a `Result`. This is more readably written as an `if let` statement.
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:26:14
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 13:15:10 +02:00
|
|
|
26 | for x in option.ok_or("x not found") {
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: consider replacing `for x in option.ok_or("x not found")` with `if let Ok(x) = option.ok_or("x not found")`
|
|
|
|
|
|
|
|
error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:31:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 13:15:10 +02:00
|
|
|
31 | / for x in v.iter().next() {
|
|
|
|
32 | | println!("{}", x);
|
|
|
|
33 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-17 14:19:44 +02:00
|
|
|
= note: `-D iter-next-loop` implied by `-D warnings`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: for loop over `v.iter().next().and(Some(0))`, which is an `Option`. This is more readably written as an `if let` statement.
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:36:14
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 13:15:10 +02:00
|
|
|
36 | for x in v.iter().next().and(Some(0)) {
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: consider replacing `for x in v.iter().next().and(Some(0))` with `if let Some(x) = v.iter().next().and(Some(0))`
|
|
|
|
|
|
|
|
error: for loop over `v.iter().next().ok_or("x not found")`, which is a `Result`. This is more readably written as an `if let` statement.
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:40:14
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 13:15:10 +02:00
|
|
|
40 | for x in v.iter().next().ok_or("x not found") {
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: consider replacing `for x in v.iter().next().ok_or("x not found")` with `if let Ok(x) = v.iter().next().ok_or("x not found")`
|
|
|
|
|
2017-06-01 06:22:15 +02:00
|
|
|
error: this loop never actually loops
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:52:5
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
|
|
|
52 | / while let Some(x) = option {
|
|
|
|
53 | | println!("{}", x);
|
|
|
|
54 | | break;
|
|
|
|
55 | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
= note: `-D never-loop` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: this loop never actually loops
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:58:5
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
|
|
|
58 | / while let Ok(x) = result {
|
|
|
|
59 | | println!("{}", x);
|
|
|
|
60 | | break;
|
|
|
|
61 | | }
|
|
|
|
| |_____^
|
|
|
|
|
2017-02-07 21:05:30 +01:00
|
|
|
error: the loop variable `i` is only used to index `vec`.
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:84:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
|
|
|
84 | / for i in 0..vec.len() {
|
|
|
|
85 | | println!("{}", vec[i]);
|
|
|
|
86 | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2017-05-17 14:19:44 +02:00
|
|
|
= note: `-D needless-range-loop` implied by `-D warnings`
|
2017-02-07 21:05:30 +01:00
|
|
|
help: consider using an iterator
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
84 | for <item> in &vec {
|
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is only used to index `vec`.
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:93:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
|
|
|
93 | for i in 0..vec.len() { let _ = vec[i]; }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-02-07 21:05:30 +01:00
|
|
|
help: consider using an iterator
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
93 | for <item> in &vec { let _ = vec[i]; }
|
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `j` is only used to index `STATIC`.
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:96:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
|
|
|
96 | / for j in 0..4 {
|
|
|
|
97 | | println!("{:?}", STATIC[j]);
|
|
|
|
98 | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2017-02-07 21:05:30 +01:00
|
|
|
help: consider using an iterator
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
96 | for <item> in STATIC.iter().take(4) {
|
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `j` is only used to index `CONST`.
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:100:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
|
|
|
100 | / for j in 0..4 {
|
|
|
|
101 | | println!("{:?}", CONST[j]);
|
|
|
|
102 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: consider using an iterator
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
100 | for <item> in CONST.iter().take(4) {
|
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is used to index `vec`
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:104:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
|
|
|
104 | / for i in 0..vec.len() {
|
|
|
|
105 | | println!("{} {}", vec[i], i);
|
|
|
|
106 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: consider using an iterator
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
104 | for (i, <item>) in vec.iter().enumerate() {
|
|
|
|
| ^^^^^^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is only used to index `vec2`.
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:111:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 13:15:10 +02:00
|
|
|
111 | / for i in 0..vec.len() {
|
|
|
|
112 | | println!("{}", vec2[i]);
|
|
|
|
113 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: consider using an iterator
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
111 | for <item> in vec2.iter().take(vec.len()) {
|
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is only used to index `vec`.
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:115:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 13:15:10 +02:00
|
|
|
115 | / for i in 5..vec.len() {
|
|
|
|
116 | | println!("{}", vec[i]);
|
|
|
|
117 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: consider using an iterator
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
115 | for <item> in vec.iter().skip(5) {
|
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is only used to index `vec`.
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:119:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
|
|
|
119 | / for i in 0..MAX_LEN {
|
|
|
|
120 | | println!("{}", vec[i]);
|
|
|
|
121 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: consider using an iterator
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
119 | for <item> in vec.iter().take(MAX_LEN) {
|
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is only used to index `vec`.
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:123:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
|
|
|
123 | / for i in 0...MAX_LEN {
|
|
|
|
124 | | println!("{}", vec[i]);
|
|
|
|
125 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: consider using an iterator
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
123 | for <item> in vec.iter().take(MAX_LEN + 1) {
|
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is only used to index `vec`.
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:127:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
|
|
|
127 | / for i in 5..10 {
|
|
|
|
128 | | println!("{}", vec[i]);
|
|
|
|
129 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: consider using an iterator
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
127 | for <item> in vec.iter().take(10).skip(5) {
|
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is only used to index `vec`.
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:131:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
|
|
|
131 | / for i in 5...10 {
|
|
|
|
132 | | println!("{}", vec[i]);
|
|
|
|
133 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: consider using an iterator
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
131 | for <item> in vec.iter().take(10 + 1).skip(5) {
|
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is used to index `vec`
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:135:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
|
|
|
135 | / for i in 5..vec.len() {
|
|
|
|
136 | | println!("{} {}", vec[i], i);
|
|
|
|
137 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: consider using an iterator
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
135 | for (i, <item>) in vec.iter().enumerate().skip(5) {
|
|
|
|
| ^^^^^^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is used to index `vec`
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:139:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
|
|
|
139 | / for i in 5..10 {
|
|
|
|
140 | | println!("{} {}", vec[i], i);
|
|
|
|
141 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: consider using an iterator
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
139 | for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
|
|
|
|
| ^^^^^^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this range is empty so this for loop will never run
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:143:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
|
|
|
143 | / for i in 10..0 {
|
|
|
|
144 | | println!("{}", i);
|
|
|
|
145 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-17 14:19:44 +02:00
|
|
|
= note: `-D reverse-range-loop` implied by `-D warnings`
|
2017-02-07 21:05:30 +01:00
|
|
|
help: consider using the following if you are attempting to iterate over this range in reverse
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
143 | for i in (0..10).rev() {
|
|
|
|
| ^^^^^^^^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this range is empty so this for loop will never run
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:147:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
|
|
|
147 | / for i in 10...0 {
|
|
|
|
148 | | println!("{}", i);
|
|
|
|
149 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: consider using the following if you are attempting to iterate over this range in reverse
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
147 | for i in (0...10).rev() {
|
|
|
|
| ^^^^^^^^^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this range is empty so this for loop will never run
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:151:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 13:15:10 +02:00
|
|
|
151 | / for i in MAX_LEN..0 {
|
|
|
|
152 | | println!("{}", i);
|
|
|
|
153 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: consider using the following if you are attempting to iterate over this range in reverse
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
151 | for i in (0..MAX_LEN).rev() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this range is empty so this for loop will never run
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:155:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 13:15:10 +02:00
|
|
|
155 | / for i in 5..5 {
|
|
|
|
156 | | println!("{}", i);
|
|
|
|
157 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this range is empty so this for loop will never run
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:176:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
|
|
|
176 | / for i in 10..5+4 {
|
|
|
|
177 | | println!("{}", i);
|
|
|
|
178 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: consider using the following if you are attempting to iterate over this range in reverse
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
176 | for i in (5+4..10).rev() {
|
|
|
|
| ^^^^^^^^^^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this range is empty so this for loop will never run
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:180:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
|
|
|
180 | / for i in (5+2)..(3-1) {
|
|
|
|
181 | | println!("{}", i);
|
|
|
|
182 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: consider using the following if you are attempting to iterate over this range in reverse
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
180 | for i in ((3-1)..(5+2)).rev() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this range is empty so this for loop will never run
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:184:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 13:15:10 +02:00
|
|
|
184 | / for i in (5+2)..(8-1) {
|
|
|
|
185 | | println!("{}", i);
|
|
|
|
186 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2017-02-21 12:13:44 +01:00
|
|
|
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:203:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
203 | for _v in vec.iter() { }
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^^ help: to write this more concisely, try: `&vec`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-17 14:19:44 +02:00
|
|
|
= note: `-D explicit-iter-loop` implied by `-D warnings`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2017-02-21 12:13:44 +01:00
|
|
|
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:205:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
205 | for _v in vec.iter_mut() { }
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut vec`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2017-02-21 12:13:44 +01:00
|
|
|
error: it is more idiomatic to loop over containers instead of using explicit iteration methods`
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:208:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
208 | for _v in out_vec.into_iter() { }
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `out_vec`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-17 14:19:44 +02:00
|
|
|
= note: `-D explicit-into-iter-loop` implied by `-D warnings`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2017-02-21 12:13:44 +01:00
|
|
|
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:211:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
211 | for _v in array.into_iter() {}
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&array`
|
2017-02-21 12:13:44 +01:00
|
|
|
|
|
|
|
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:216:15
|
2017-02-21 12:13:44 +01:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
216 | for _v in [1, 2, 3].iter() { }
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[1, 2, 3]`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2017-02-21 12:13:44 +01:00
|
|
|
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:220:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
220 | for _v in [0; 32].iter() {}
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[0; 32]`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2017-02-21 12:13:44 +01:00
|
|
|
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:225:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
225 | for _v in ll.iter() { }
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^ help: to write this more concisely, try: `&ll`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2017-02-21 12:13:44 +01:00
|
|
|
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:228:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
228 | for _v in vd.iter() { }
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^ help: to write this more concisely, try: `&vd`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2017-02-21 12:13:44 +01:00
|
|
|
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:231:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
231 | for _v in bh.iter() { }
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^ help: to write this more concisely, try: `&bh`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2017-02-21 12:13:44 +01:00
|
|
|
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:234:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
234 | for _v in hm.iter() { }
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^ help: to write this more concisely, try: `&hm`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2017-02-21 12:13:44 +01:00
|
|
|
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:237:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
237 | for _v in bt.iter() { }
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^ help: to write this more concisely, try: `&bt`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2017-02-21 12:13:44 +01:00
|
|
|
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:240:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
240 | for _v in hs.iter() { }
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^ help: to write this more concisely, try: `&hs`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2017-02-21 12:13:44 +01:00
|
|
|
error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:243:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
243 | for _v in bs.iter() { }
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^ help: to write this more concisely, try: `&bs`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:245:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
245 | for _v in vec.iter().next() { }
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: you are collect()ing an iterator and throwing away the result. Consider using an explicit for loop to exhaust the iterator
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:252:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-07-10 15:30:28 +02:00
|
|
|
252 | vec.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-17 14:19:44 +02:00
|
|
|
= note: `-D unused-collect` implied by `-D warnings`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the variable `_index` is used as a loop counter. Consider using `for (_index, item) in &vec.enumerate()` or similar iterators
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:257:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
257 | for _v in &vec { _index += 1 }
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-05-17 14:19:44 +02:00
|
|
|
= note: `-D explicit-counter-loop` implied by `-D warnings`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the variable `_index` is used as a loop counter. Consider using `for (_index, item) in &vec.enumerate()` or similar iterators
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:261:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
261 | for _v in &vec { _index += 1 }
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: you seem to want to iterate on a map's values
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:321:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
321 | / for (_, v) in &m {
|
|
|
|
322 | | let _v = v;
|
|
|
|
323 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-17 14:19:44 +02:00
|
|
|
= note: `-D for-kv-map` implied by `-D warnings`
|
2017-02-07 21:05:30 +01:00
|
|
|
help: use the corresponding method
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
321 | for v in m.values() {
|
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: you seem to want to iterate on a map's values
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:326:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
326 | / for (_, v) in &*m {
|
|
|
|
327 | | let _v = v;
|
|
|
|
328 | | // Here the `*` is not actually necesarry, but the test tests that we don't suggest
|
|
|
|
329 | | // `in *m.values()` as we used to
|
|
|
|
330 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: use the corresponding method
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
326 | for v in (*m).values() {
|
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: you seem to want to iterate on a map's values
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:333:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
333 | / for (_, v) in &mut m {
|
|
|
|
334 | | let _v = v;
|
|
|
|
335 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: use the corresponding method
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
333 | for v in m.values_mut() {
|
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: you seem to want to iterate on a map's values
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:338:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
338 | / for (_, v) in &mut *m {
|
|
|
|
339 | | let _v = v;
|
|
|
|
340 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: use the corresponding method
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
338 | for v in (*m).values_mut() {
|
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: you seem to want to iterate on a map's keys
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:344:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-07-05 08:14:24 +02:00
|
|
|
344 | / for (k, _value) in rm {
|
|
|
|
345 | | let _k = k;
|
|
|
|
346 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
help: use the corresponding method
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
|
|
|
344 | for k in rm.keys() {
|
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2017-08-11 14:11:46 +02:00
|
|
|
error: aborting due to 50 previous errors
|
2017-05-17 14:19:44 +02:00
|
|
|
|