]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/cyclomatic_complexity.stderr
Auto merge of #3603 - xfix:random-state-lint, r=phansch
[rust.git] / tests / ui / cyclomatic_complexity.stderr
index ddc2f5b159f22785e672db3f477dcac2e69e1945..f8e3a54debda375e55b5c50a6d90ae804c18ded1 100644 (file)
 error: the function has a cyclomatic complexity of 28
-  --> $DIR/cyclomatic_complexity.rs:17:1
+  --> $DIR/cyclomatic_complexity.rs:15:1
    |
-17 | / fn main() {
-18 | |     if true {
-19 | |         println!("a");
-20 | |     }
+LL | / fn main() {
+LL | |     if true {
+LL | |         println!("a");
+LL | |     }
 ...  |
-98 | |     }
-99 | | }
+LL | |     }
+LL | | }
    | |_^
    |
    = note: `-D clippy::cyclomatic-complexity` implied by `-D warnings`
    = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 7
-   --> $DIR/cyclomatic_complexity.rs:102:1
-    |
-102 | / fn kaboom() {
-103 | |     let n = 0;
-104 | |     'a: for i in 0..20 {
-105 | |         'b: for j in i..20 {
-...   |
-120 | |     }
-121 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:100:1
+   |
+LL | / fn kaboom() {
+LL | |     let n = 0;
+LL | |     'a: for i in 0..20 {
+LL | |         'b: for j in i..20 {
+...  |
+LL | |     }
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 1
-   --> $DIR/cyclomatic_complexity.rs:148:1
-    |
-148 | / fn lots_of_short_circuits() -> bool {
-149 | |     true && false && true && false && true && false && true
-150 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:146:1
+   |
+LL | / fn lots_of_short_circuits() -> bool {
+LL | |     true && false && true && false && true && false && true
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 1
-   --> $DIR/cyclomatic_complexity.rs:153:1
-    |
-153 | / fn lots_of_short_circuits2() -> bool {
-154 | |     true || false || true || false || true || false || true
-155 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:151:1
+   |
+LL | / fn lots_of_short_circuits2() -> bool {
+LL | |     true || false || true || false || true || false || true
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 2
-   --> $DIR/cyclomatic_complexity.rs:158:1
-    |
-158 | / fn baa() {
-159 | |     let x = || match 99 {
-160 | |         0 => 0,
-161 | |         1 => 1,
-...   |
-172 | |     }
-173 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:156:1
+   |
+LL | / fn baa() {
+LL | |     let x = || match 99 {
+LL | |         0 => 0,
+LL | |         1 => 1,
+...  |
+LL | |     }
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 2
-   --> $DIR/cyclomatic_complexity.rs:159:13
-    |
-159 |       let x = || match 99 {
-    |  _____________^
-160 | |         0 => 0,
-161 | |         1 => 1,
-162 | |         2 => 2,
-...   |
-166 | |         _ => 42,
-167 | |     };
-    | |_____^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:157:13
+   |
+LL |       let x = || match 99 {
+   |  _____________^
+LL | |         0 => 0,
+LL | |         1 => 1,
+LL | |         2 => 2,
+...  |
+LL | |         _ => 42,
+LL | |     };
+   | |_____^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 2
-   --> $DIR/cyclomatic_complexity.rs:176:1
-    |
-176 | / fn bar() {
-177 | |     match 99 {
-178 | |         0 => println!("hi"),
-179 | |         _ => println!("bye"),
-180 | |     }
-181 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:174:1
+   |
+LL | / fn bar() {
+LL | |     match 99 {
+LL | |         0 => println!("hi"),
+LL | |         _ => println!("bye"),
+LL | |     }
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 2
-   --> $DIR/cyclomatic_complexity.rs:195:1
-    |
-195 | / fn barr() {
-196 | |     match 99 {
-197 | |         0 => println!("hi"),
-198 | |         1 => println!("bla"),
-...   |
-201 | |     }
-202 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:193:1
+   |
+LL | / fn barr() {
+LL | |     match 99 {
+LL | |         0 => println!("hi"),
+LL | |         1 => println!("bla"),
+...  |
+LL | |     }
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 3
-   --> $DIR/cyclomatic_complexity.rs:205:1
-    |
-205 | / fn barr2() {
-206 | |     match 99 {
-207 | |         0 => println!("hi"),
-208 | |         1 => println!("bla"),
-...   |
-217 | |     }
-218 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:203:1
+   |
+LL | / fn barr2() {
+LL | |     match 99 {
+LL | |         0 => println!("hi"),
+LL | |         1 => println!("bla"),
+...  |
+LL | |     }
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 2
-   --> $DIR/cyclomatic_complexity.rs:221:1
-    |
-221 | / fn barrr() {
-222 | |     match 99 {
-223 | |         0 => println!("hi"),
-224 | |         1 => panic!("bla"),
-...   |
-227 | |     }
-228 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:219:1
+   |
+LL | / fn barrr() {
+LL | |     match 99 {
+LL | |         0 => println!("hi"),
+LL | |         1 => panic!("bla"),
+...  |
+LL | |     }
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 3
-   --> $DIR/cyclomatic_complexity.rs:231:1
-    |
-231 | / fn barrr2() {
-232 | |     match 99 {
-233 | |         0 => println!("hi"),
-234 | |         1 => panic!("bla"),
-...   |
-243 | |     }
-244 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:229:1
+   |
+LL | / fn barrr2() {
+LL | |     match 99 {
+LL | |         0 => println!("hi"),
+LL | |         1 => panic!("bla"),
+...  |
+LL | |     }
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 2
-   --> $DIR/cyclomatic_complexity.rs:247:1
-    |
-247 | / fn barrrr() {
-248 | |     match 99 {
-249 | |         0 => println!("hi"),
-250 | |         1 => println!("bla"),
-...   |
-253 | |     }
-254 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:245:1
+   |
+LL | / fn barrrr() {
+LL | |     match 99 {
+LL | |         0 => println!("hi"),
+LL | |         1 => println!("bla"),
+...  |
+LL | |     }
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 3
-   --> $DIR/cyclomatic_complexity.rs:257:1
-    |
-257 | / fn barrrr2() {
-258 | |     match 99 {
-259 | |         0 => println!("hi"),
-260 | |         1 => println!("bla"),
-...   |
-269 | |     }
-270 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:255:1
+   |
+LL | / fn barrrr2() {
+LL | |     match 99 {
+LL | |         0 => println!("hi"),
+LL | |         1 => println!("bla"),
+...  |
+LL | |     }
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 2
-   --> $DIR/cyclomatic_complexity.rs:273:1
-    |
-273 | / fn cake() {
-274 | |     if 4 == 5 {
-275 | |         println!("yea");
-276 | |     } else {
-...   |
-279 | |     println!("whee");
-280 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:271:1
+   |
+LL | / fn cake() {
+LL | |     if 4 == 5 {
+LL | |         println!("yea");
+LL | |     } else {
+...  |
+LL | |     println!("whee");
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 4
-   --> $DIR/cyclomatic_complexity.rs:284:1
-    |
-284 | / pub fn read_file(input_path: &str) -> String {
-285 | |     use std::fs::File;
-286 | |     use std::io::{Read, Write};
-287 | |     use std::path::Path;
-...   |
-309 | |     }
-310 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:281:1
+   |
+LL | / pub fn read_file(input_path: &str) -> String {
+LL | |     use std::fs::File;
+LL | |     use std::io::{Read, Write};
+LL | |     use std::path::Path;
+...  |
+LL | |     }
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 1
-   --> $DIR/cyclomatic_complexity.rs:315:1
-    |
-315 | / fn void(void: Void) {
-316 | |     if true {
-317 | |         match void {
-318 | |         }
-319 | |     }
-320 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:312:1
+   |
+LL | / fn void(void: Void) {
+LL | |     if true {
+LL | |         match void {}
+LL | |     }
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 1
-   --> $DIR/cyclomatic_complexity.rs:329:1
-    |
-329 | / fn try() -> Result<i32, &'static str> {
-330 | |     match 5 {
-331 | |         5 => Ok(5),
-332 | |         _ => return Err("bla"),
-333 | |     }
-334 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:325:1
+   |
+LL | / fn try() -> Result<i32, &'static str> {
+LL | |     match 5 {
+LL | |         5 => Ok(5),
+LL | |         _ => return Err("bla"),
+LL | |     }
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 1
-   --> $DIR/cyclomatic_complexity.rs:337:1
-    |
-337 | / fn try_again() -> Result<i32, &'static str> {
-338 | |     let _ = try!(Ok(42));
-339 | |     let _ = try!(Ok(43));
-340 | |     let _ = try!(Ok(44));
-...   |
-349 | |     }
-350 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:333:1
+   |
+LL | / fn try_again() -> Result<i32, &'static str> {
+LL | |     let _ = try!(Ok(42));
+LL | |     let _ = try!(Ok(43));
+LL | |     let _ = try!(Ok(44));
+...  |
+LL | |     }
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 1
-   --> $DIR/cyclomatic_complexity.rs:353:1
-    |
-353 | / fn early() -> Result<i32, &'static str> {
-354 | |     return Ok(5);
-355 | |     return Ok(5);
-356 | |     return Ok(5);
-...   |
-362 | |     return Ok(5);
-363 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:349:1
+   |
+LL | / fn early() -> Result<i32, &'static str> {
+LL | |     return Ok(5);
+LL | |     return Ok(5);
+LL | |     return Ok(5);
+...  |
+LL | |     return Ok(5);
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: the function has a cyclomatic complexity of 8
-   --> $DIR/cyclomatic_complexity.rs:366:1
-    |
-366 | / fn early_ret() -> i32 {
-367 | |     let a = if true { 42 } else { return 0; };
-368 | |     let a = if a < 99 { 42 } else { return 0; };
-369 | |     let a = if a < 99 { 42 } else { return 0; };
-...   |
-382 | |     }
-383 | | }
-    | |_^
-    |
-    = help: you could split it up into multiple smaller functions
+  --> $DIR/cyclomatic_complexity.rs:363:1
+   |
+LL | / fn early_ret() -> i32 {
+LL | |     let a = if true { 42 } else { return 0; };
+LL | |     let a = if a < 99 { 42 } else { return 0; };
+LL | |     let a = if a < 99 { 42 } else { return 0; };
+...  |
+LL | |     }
+LL | | }
+   | |_^
+   |
+   = help: you could split it up into multiple smaller functions
 
 error: aborting due to 20 previous errors