]> git.lizzy.rs Git - rust.git/blob - tests/ui/cognitive_complexity.stderr
Merge branch 'master' into fix-4514
[rust.git] / tests / ui / cognitive_complexity.stderr
1 error: the function has a cognitive complexity of (28/25)
2   --> $DIR/cognitive_complexity.rs:6:1
3    |
4 LL | / fn main() {
5 LL | |     if true {
6 LL | |         println!("a");
7 LL | |     }
8 ...  |
9 LL | |     }
10 LL | | }
11    | |_^
12    |
13    = note: `-D clippy::cognitive-complexity` implied by `-D warnings`
14    = help: you could split it up into multiple smaller functions
15
16 error: the function has a cognitive complexity of (7/1)
17   --> $DIR/cognitive_complexity.rs:91:1
18    |
19 LL | / fn kaboom() {
20 LL | |     let n = 0;
21 LL | |     'a: for i in 0..20 {
22 LL | |         'b: for j in i..20 {
23 ...  |
24 LL | |     }
25 LL | | }
26    | |_^
27    |
28    = help: you could split it up into multiple smaller functions
29
30 error: the function has a cognitive complexity of (2/1)
31   --> $DIR/cognitive_complexity.rs:149:1
32    |
33 LL | / fn baa() {
34 LL | |     let x = || match 99 {
35 LL | |         0 => 0,
36 LL | |         1 => 1,
37 ...  |
38 LL | |     }
39 LL | | }
40    | |_^
41    |
42    = help: you could split it up into multiple smaller functions
43
44 error: the function has a cognitive complexity of (2/1)
45   --> $DIR/cognitive_complexity.rs:150:13
46    |
47 LL |       let x = || match 99 {
48    |  _____________^
49 LL | |         0 => 0,
50 LL | |         1 => 1,
51 LL | |         2 => 2,
52 ...  |
53 LL | |         _ => 42,
54 LL | |     };
55    | |_____^
56    |
57    = help: you could split it up into multiple smaller functions
58
59 error: the function has a cognitive complexity of (2/1)
60   --> $DIR/cognitive_complexity.rs:167:1
61    |
62 LL | / fn bar() {
63 LL | |     match 99 {
64 LL | |         0 => println!("hi"),
65 LL | |         _ => println!("bye"),
66 LL | |     }
67 LL | | }
68    | |_^
69    |
70    = help: you could split it up into multiple smaller functions
71
72 error: the function has a cognitive complexity of (2/1)
73   --> $DIR/cognitive_complexity.rs:186:1
74    |
75 LL | / fn barr() {
76 LL | |     match 99 {
77 LL | |         0 => println!("hi"),
78 LL | |         1 => println!("bla"),
79 ...  |
80 LL | |     }
81 LL | | }
82    | |_^
83    |
84    = help: you could split it up into multiple smaller functions
85
86 error: the function has a cognitive complexity of (3/1)
87   --> $DIR/cognitive_complexity.rs:196:1
88    |
89 LL | / fn barr2() {
90 LL | |     match 99 {
91 LL | |         0 => println!("hi"),
92 LL | |         1 => println!("bla"),
93 ...  |
94 LL | |     }
95 LL | | }
96    | |_^
97    |
98    = help: you could split it up into multiple smaller functions
99
100 error: the function has a cognitive complexity of (2/1)
101   --> $DIR/cognitive_complexity.rs:212:1
102    |
103 LL | / fn barrr() {
104 LL | |     match 99 {
105 LL | |         0 => println!("hi"),
106 LL | |         1 => panic!("bla"),
107 ...  |
108 LL | |     }
109 LL | | }
110    | |_^
111    |
112    = help: you could split it up into multiple smaller functions
113
114 error: the function has a cognitive complexity of (3/1)
115   --> $DIR/cognitive_complexity.rs:222:1
116    |
117 LL | / fn barrr2() {
118 LL | |     match 99 {
119 LL | |         0 => println!("hi"),
120 LL | |         1 => panic!("bla"),
121 ...  |
122 LL | |     }
123 LL | | }
124    | |_^
125    |
126    = help: you could split it up into multiple smaller functions
127
128 error: the function has a cognitive complexity of (2/1)
129   --> $DIR/cognitive_complexity.rs:238:1
130    |
131 LL | / fn barrrr() {
132 LL | |     match 99 {
133 LL | |         0 => println!("hi"),
134 LL | |         1 => println!("bla"),
135 ...  |
136 LL | |     }
137 LL | | }
138    | |_^
139    |
140    = help: you could split it up into multiple smaller functions
141
142 error: the function has a cognitive complexity of (3/1)
143   --> $DIR/cognitive_complexity.rs:248:1
144    |
145 LL | / fn barrrr2() {
146 LL | |     match 99 {
147 LL | |         0 => println!("hi"),
148 LL | |         1 => println!("bla"),
149 ...  |
150 LL | |     }
151 LL | | }
152    | |_^
153    |
154    = help: you could split it up into multiple smaller functions
155
156 error: the function has a cognitive complexity of (2/1)
157   --> $DIR/cognitive_complexity.rs:264:1
158    |
159 LL | / fn cake() {
160 LL | |     if 4 == 5 {
161 LL | |         println!("yea");
162 LL | |     } else {
163 ...  |
164 LL | |     println!("whee");
165 LL | | }
166    | |_^
167    |
168    = help: you could split it up into multiple smaller functions
169
170 error: the function has a cognitive complexity of (4/1)
171   --> $DIR/cognitive_complexity.rs:274:1
172    |
173 LL | / pub fn read_file(input_path: &str) -> String {
174 LL | |     use std::fs::File;
175 LL | |     use std::io::{Read, Write};
176 LL | |     use std::path::Path;
177 ...  |
178 LL | |     }
179 LL | | }
180    | |_^
181    |
182    = help: you could split it up into multiple smaller functions
183
184 error: the function has a cognitive complexity of (2/1)
185   --> $DIR/cognitive_complexity.rs:305:1
186    |
187 LL | / fn void(void: Void) {
188 LL | |     if true {
189 LL | |         match void {}
190 LL | |     }
191 LL | | }
192    | |_^
193    |
194    = help: you could split it up into multiple smaller functions
195
196 error: the function has a cognitive complexity of (8/1)
197   --> $DIR/cognitive_complexity.rs:356:1
198    |
199 LL | / fn early_ret() -> i32 {
200 LL | |     let a = if true { 42 } else { return 0; };
201 LL | |     let a = if a < 99 { 42 } else { return 0; };
202 LL | |     let a = if a < 99 { 42 } else { return 0; };
203 ...  |
204 LL | |     }
205 LL | | }
206    | |_^
207    |
208    = help: you could split it up into multiple smaller functions
209
210 error: aborting due to 15 previous errors
211