]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/panic_in_result_fn.stderr
Auto merge of #97191 - wesleywiser:main_thread_name, r=ChrisDenton
[rust.git] / src / tools / clippy / tests / ui / panic_in_result_fn.stderr
1 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
2   --> $DIR/panic_in_result_fn.rs:6:5
3    |
4 LL | /     fn result_with_panic() -> Result<bool, String> // should emit lint
5 LL | |     {
6 LL | |         panic!("error");
7 LL | |     }
8    | |_____^
9    |
10    = note: `-D clippy::panic-in-result-fn` implied by `-D warnings`
11    = help: `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertions should not be used in a function that returns `Result` as `Result` is expected to return an error instead of crashing
12 note: return Err() instead of panicking
13   --> $DIR/panic_in_result_fn.rs:8:9
14    |
15 LL |         panic!("error");
16    |         ^^^^^^^^^^^^^^^
17
18 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
19   --> $DIR/panic_in_result_fn.rs:11:5
20    |
21 LL | /     fn result_with_unimplemented() -> Result<bool, String> // should emit lint
22 LL | |     {
23 LL | |         unimplemented!();
24 LL | |     }
25    | |_____^
26    |
27    = help: `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertions should not be used in a function that returns `Result` as `Result` is expected to return an error instead of crashing
28 note: return Err() instead of panicking
29   --> $DIR/panic_in_result_fn.rs:13:9
30    |
31 LL |         unimplemented!();
32    |         ^^^^^^^^^^^^^^^^
33
34 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
35   --> $DIR/panic_in_result_fn.rs:16:5
36    |
37 LL | /     fn result_with_unreachable() -> Result<bool, String> // should emit lint
38 LL | |     {
39 LL | |         unreachable!();
40 LL | |     }
41    | |_____^
42    |
43    = help: `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertions should not be used in a function that returns `Result` as `Result` is expected to return an error instead of crashing
44 note: return Err() instead of panicking
45   --> $DIR/panic_in_result_fn.rs:18:9
46    |
47 LL |         unreachable!();
48    |         ^^^^^^^^^^^^^^
49
50 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
51   --> $DIR/panic_in_result_fn.rs:21:5
52    |
53 LL | /     fn result_with_todo() -> Result<bool, String> // should emit lint
54 LL | |     {
55 LL | |         todo!("Finish this");
56 LL | |     }
57    | |_____^
58    |
59    = help: `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertions should not be used in a function that returns `Result` as `Result` is expected to return an error instead of crashing
60 note: return Err() instead of panicking
61   --> $DIR/panic_in_result_fn.rs:23:9
62    |
63 LL |         todo!("Finish this");
64    |         ^^^^^^^^^^^^^^^^^^^^
65
66 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
67   --> $DIR/panic_in_result_fn.rs:52:1
68    |
69 LL | / fn function_result_with_panic() -> Result<bool, String> // should emit lint
70 LL | | {
71 LL | |     panic!("error");
72 LL | | }
73    | |_^
74    |
75    = help: `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertions should not be used in a function that returns `Result` as `Result` is expected to return an error instead of crashing
76 note: return Err() instead of panicking
77   --> $DIR/panic_in_result_fn.rs:54:5
78    |
79 LL |     panic!("error");
80    |     ^^^^^^^^^^^^^^^
81
82 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
83   --> $DIR/panic_in_result_fn.rs:67:1
84    |
85 LL | / fn main() -> Result<(), String> {
86 LL | |     todo!("finish main method");
87 LL | |     Ok(())
88 LL | | }
89    | |_^
90    |
91    = help: `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertions should not be used in a function that returns `Result` as `Result` is expected to return an error instead of crashing
92 note: return Err() instead of panicking
93   --> $DIR/panic_in_result_fn.rs:68:5
94    |
95 LL |     todo!("finish main method");
96    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
97
98 error: aborting due to 6 previous errors
99