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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:32:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
32 | / for x in v.iter().next() {
|
|
|
|
33 | | println!("{}", x);
|
|
|
|
34 | | }
|
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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:37:14
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
37 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:41:14
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
41 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:53:5
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
53 | / while let Some(x) = option {
|
|
|
|
54 | | println!("{}", x);
|
|
|
|
55 | | break;
|
|
|
|
56 | | }
|
2017-06-01 06:22:15 +02:00
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
= note: `-D never-loop` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: this loop never actually loops
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:59:5
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
59 | / while let Ok(x) = result {
|
|
|
|
60 | | println!("{}", x);
|
|
|
|
61 | | break;
|
|
|
|
62 | | }
|
2017-06-01 06:22:15 +02:00
|
|
|
| |_____^
|
|
|
|
|
2017-02-07 21:05:30 +01:00
|
|
|
error: the loop variable `i` is only used to index `vec`.
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:86:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
86 | / for i in 0..vec.len() {
|
|
|
|
87 | | println!("{}", vec[i]);
|
|
|
|
88 | | }
|
2017-05-11 13:15:10 +02:00
|
|
|
| |_____^
|
|
|
|
|
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
86 | for <item> in &vec {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is only used to index `vec`.
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:95:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
95 | / for i in 0..vec.len() {
|
|
|
|
96 | | let _ = vec[i];
|
|
|
|
97 | | }
|
2017-05-11 13:15:10 +02:00
|
|
|
| |_____^
|
|
|
|
|
|
2017-02-07 21:05:30 +01:00
|
|
|
help: consider using an iterator
|
2017-07-10 15:29:29 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
95 | for <item> in &vec {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
error: the loop variable `j` is only used to index `STATIC`.
|
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 {
|
2017-09-05 12:53:52 +02:00
|
|
|
101 | | println!("{:?}", STATIC[j]);
|
2017-05-11 13:15:10 +02:00
|
|
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
100 | for <item> in STATIC.iter().take(4) {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
error: the loop variable `j` is only used to index `CONST`.
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/for_loop.rs:104:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
104 | / for j in 0..4 {
|
|
|
|
105 | | println!("{:?}", CONST[j]);
|
2017-05-11 13:15:10 +02:00
|
|
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
104 | for <item> in CONST.iter().take(4) {
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
error: the loop variable `i` is used to index `vec`
|
|
|
|
--> $DIR/for_loop.rs:108:5
|
|
|
|
|
|
|
|
|
108 | / for i in 0..vec.len() {
|
|
|
|
109 | | println!("{} {}", vec[i], i);
|
|
|
|
110 | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
help: consider using an iterator
|
|
|
|
|
|
|
|
|
108 | for (i, <item>) in vec.iter().enumerate() {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^^^^^^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is only used to index `vec2`.
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:116:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
116 | / for i in 0..vec.len() {
|
|
|
|
117 | | println!("{}", vec2[i]);
|
|
|
|
118 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
116 | for <item> in vec2.iter().take(vec.len()) {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is only used to index `vec`.
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:120:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
120 | / for i in 5..vec.len() {
|
|
|
|
121 | | println!("{}", vec[i]);
|
|
|
|
122 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
120 | for <item> in vec.iter().skip(5) {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is only used to index `vec`.
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:124:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
124 | / for i in 0..MAX_LEN {
|
|
|
|
125 | | println!("{}", vec[i]);
|
|
|
|
126 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
124 | for <item> in vec.iter().take(MAX_LEN) {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is only used to index `vec`.
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:128:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-28 19:40:19 +02:00
|
|
|
128 | / for i in 0..=MAX_LEN {
|
2017-09-05 12:53:52 +02:00
|
|
|
129 | | println!("{}", vec[i]);
|
|
|
|
130 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
128 | for <item> in vec.iter().take(MAX_LEN + 1) {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is only used to index `vec`.
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:132:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
132 | / for i in 5..10 {
|
|
|
|
133 | | println!("{}", vec[i]);
|
|
|
|
134 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
132 | for <item> in vec.iter().take(10).skip(5) {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is only used to index `vec`.
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:136:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-28 19:40:19 +02:00
|
|
|
136 | / for i in 5..=10 {
|
2017-09-05 12:53:52 +02:00
|
|
|
137 | | println!("{}", vec[i]);
|
|
|
|
138 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
136 | for <item> in vec.iter().take(10 + 1).skip(5) {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is used to index `vec`
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:140:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
140 | / for i in 5..vec.len() {
|
|
|
|
141 | | println!("{} {}", vec[i], i);
|
|
|
|
142 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
140 | for (i, <item>) in vec.iter().enumerate().skip(5) {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^^^^^^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: the loop variable `i` is used to index `vec`
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:144:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
144 | / for i in 5..10 {
|
|
|
|
145 | | println!("{} {}", vec[i], i);
|
|
|
|
146 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
144 | for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^^^^^^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this range is empty so this for loop will never run
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:148:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
148 | / for i in 10..0 {
|
|
|
|
149 | | println!("{}", i);
|
|
|
|
150 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
148 | for i in (0..10).rev() {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^^^^^^^^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this range is empty so this for loop will never run
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:152:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-28 19:40:19 +02:00
|
|
|
152 | / for i in 10..=0 {
|
2017-09-05 12:53:52 +02:00
|
|
|
153 | | println!("{}", i);
|
|
|
|
154 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
152 | for i in (0...10).rev() {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this range is empty so this for loop will never run
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:156:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
156 | / for i in MAX_LEN..0 {
|
|
|
|
157 | | println!("{}", i);
|
|
|
|
158 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
156 | for i in (0..MAX_LEN).rev() {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this range is empty so this for loop will never run
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:160:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
160 | / for i in 5..5 {
|
|
|
|
161 | | println!("{}", i);
|
|
|
|
162 | | }
|
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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:185:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
185 | / for i in 10..5 + 4 {
|
|
|
|
186 | | println!("{}", i);
|
|
|
|
187 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
185 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:189:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
189 | / for i in (5 + 2)..(3 - 1) {
|
|
|
|
190 | | println!("{}", i);
|
|
|
|
191 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
189 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:193:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
193 | / for i in (5 + 2)..(8 - 1) {
|
|
|
|
194 | | println!("{}", i);
|
|
|
|
195 | | }
|
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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:215:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
215 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:217:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
217 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:220:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
220 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:223:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
223 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:228:15
|
2017-02-21 12:13:44 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
228 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:232:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
232 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:237:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
237 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:240:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
240 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:243:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
243 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:246:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
246 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:249:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
249 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:252:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
252 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:255:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
255 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:257:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
257 | 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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:264:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
264 | vec.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>();
|
2017-07-10 15:30:28 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:269:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
269 | / for _v in &vec {
|
|
|
|
270 | | _index += 1
|
|
|
|
271 | | }
|
|
|
|
| |_____^
|
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-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:275:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
275 | / for _v in &vec {
|
|
|
|
276 | | _index += 1
|
|
|
|
277 | | }
|
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: you seem to want to iterate on a map's values
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:385:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
385 | / for (_, v) in &m {
|
|
|
|
386 | | let _v = v;
|
|
|
|
387 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
385 | for v in m.values() {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: you seem to want to iterate on a map's values
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:390:5
|
|
|
|
|
|
|
|
|
390 | / for (_, v) in &*m {
|
|
|
|
391 | | let _v = v;
|
|
|
|
392 | | // Here the `*` is not actually necesarry, but the test tests that we don't
|
|
|
|
393 | | // suggest
|
|
|
|
394 | | // `in *m.values()` as we used to
|
|
|
|
395 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
390 | for v in (*m).values() {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: you seem to want to iterate on a map's values
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:398:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
398 | / for (_, v) in &mut m {
|
|
|
|
399 | | let _v = v;
|
|
|
|
400 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
398 | for v in m.values_mut() {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: you seem to want to iterate on a map's values
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:403:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
403 | / for (_, v) in &mut *m {
|
|
|
|
404 | | let _v = v;
|
|
|
|
405 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
403 | for v in (*m).values_mut() {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: you seem to want to iterate on a map's keys
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:409:5
|
2017-05-11 13:15:10 +02:00
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
409 | / for (k, _value) in rm {
|
|
|
|
410 | | let _k = k;
|
|
|
|
411 | | }
|
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
|
|
|
|
|
2017-09-05 12:53:52 +02:00
|
|
|
409 | for k in rm.keys() {
|
2017-07-10 15:29:29 +02:00
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2017-09-05 02:16:34 +02:00
|
|
|
error: it looks like you're manually copying between slices
|
|
|
|
--> $DIR/for_loop.rs:462:5
|
|
|
|
|
|
|
|
|
462 | / for i in 0..src.len() {
|
|
|
|
463 | | dst[i] = src[i];
|
|
|
|
464 | | }
|
|
|
|
| |_____^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
|
|
|
|
|
|
|
|
|
= note: `-D manual-memcpy` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:467:5
|
|
|
|
|
|
|
|
|
467 | / for i in 0..src.len() {
|
|
|
|
468 | | dst[i + 10] = src[i];
|
|
|
|
469 | | }
|
2017-09-05 02:16:34 +02:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[10..(src.len() + 10)].clone_from_slice(&src[..])`
|
2017-09-05 12:53:52 +02:00
|
|
|
|
2017-09-05 02:16:34 +02:00
|
|
|
error: it looks like you're manually copying between slices
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:472:5
|
|
|
|
|
|
|
|
|
472 | / for i in 0..src.len() {
|
|
|
|
473 | | dst[i] = src[i + 10];
|
|
|
|
474 | | }
|
2017-09-05 02:16:34 +02:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[10..])`
|
2017-09-05 12:53:52 +02:00
|
|
|
|
2017-09-05 02:16:34 +02:00
|
|
|
error: it looks like you're manually copying between slices
|
2017-09-05 12:53:52 +02:00
|
|
|
--> $DIR/for_loop.rs:477:5
|
|
|
|
|
|
|
|
|
477 | / for i in 11..src.len() {
|
|
|
|
478 | | dst[i] = src[i - 10];
|
|
|
|
479 | | }
|
2017-09-05 02:16:34 +02:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[11..src.len()].clone_from_slice(&src[(11 - 10)..(src.len() - 10)])`
|
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
|
|
|
--> $DIR/for_loop.rs:482:5
|
2017-09-05 12:53:52 +02:00
|
|
|
|
|
2017-09-05 02:16:34 +02:00
|
|
|
482 | / for i in 0..dst.len() {
|
|
|
|
483 | | dst[i] = src[i];
|
|
|
|
484 | | }
|
|
|
|
| |_____^ help: try replacing the loop by: `dst.clone_from_slice(&src[..dst.len()])`
|
2017-09-05 12:53:52 +02:00
|
|
|
|
2017-09-05 02:16:34 +02:00
|
|
|
error: it looks like you're manually copying between slices
|
|
|
|
--> $DIR/for_loop.rs:495:5
|
2017-09-05 12:53:52 +02:00
|
|
|
|
|
2017-09-05 02:16:34 +02:00
|
|
|
495 | / for i in 10..256 {
|
|
|
|
496 | | dst[i] = src[i - 5];
|
|
|
|
497 | | dst2[i + 500] = src[i]
|
|
|
|
498 | | }
|
2017-09-05 12:53:52 +02:00
|
|
|
| |_____^
|
|
|
|
|
|
2017-09-05 02:16:34 +02:00
|
|
|
help: try replacing the loop by
|
2017-09-05 12:53:52 +02:00
|
|
|
|
|
2017-09-05 02:16:34 +02:00
|
|
|
495 | dst[10..256].clone_from_slice(&src[(10 - 5)..(256 - 5)])
|
|
|
|
496 | dst2[(10 + 500)..(256 + 500)].clone_from_slice(&src[10..256])
|
|
|
|
|
|
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
|
|
|
--> $DIR/for_loop.rs:507:5
|
|
|
|
|
|
|
|
|
507 | / for i in 10..LOOP_OFFSET {
|
|
|
|
508 | | dst[i + LOOP_OFFSET] = src[i - some_var];
|
|
|
|
509 | | }
|
|
|
|
| |_____^ help: try replacing the loop by: `dst[(10 + LOOP_OFFSET)..(LOOP_OFFSET + LOOP_OFFSET)].clone_from_slice(&src[(10 - some_var)..(LOOP_OFFSET - some_var)])`
|
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
|
|
|
--> $DIR/for_loop.rs:520:5
|
|
|
|
|
|
|
|
|
520 | / for i in 0..src_vec.len() {
|
|
|
|
521 | | dst_vec[i] = src_vec[i];
|
|
|
|
522 | | }
|
|
|
|
| |_____^ help: try replacing the loop by: `dst_vec[..src_vec.len()].clone_from_slice(&src_vec[..])`
|
2017-09-05 12:53:52 +02:00
|
|
|
|
2017-09-17 01:17:22 +02:00
|
|
|
error: it looks like you're manually copying between slices
|
|
|
|
--> $DIR/for_loop.rs:547:5
|
|
|
|
|
|
|
|
|
547 | / for i in 0..src.len() {
|
|
|
|
548 | | dst[i] = src[i].clone();
|
|
|
|
549 | | }
|
|
|
|
| |_____^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
|
|
|
|
|