1 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
2 --> $DIR/panic_in_result_fn.rs:6:5
4 LL | / fn result_with_panic() -> Result<bool, String> // should emit lint
6 LL | | panic!("error");
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
18 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
19 --> $DIR/panic_in_result_fn.rs:11:5
21 LL | / fn result_with_unimplemented() -> Result<bool, String> // should emit lint
23 LL | | unimplemented!();
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
31 LL | unimplemented!();
34 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
35 --> $DIR/panic_in_result_fn.rs:16:5
37 LL | / fn result_with_unreachable() -> Result<bool, String> // should emit lint
39 LL | | unreachable!();
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
50 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
51 --> $DIR/panic_in_result_fn.rs:21:5
53 LL | / fn result_with_todo() -> Result<bool, String> // should emit lint
55 LL | | todo!("Finish this");
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
63 LL | todo!("Finish this");
64 | ^^^^^^^^^^^^^^^^^^^^
66 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
67 --> $DIR/panic_in_result_fn.rs:52:1
69 LL | / fn function_result_with_panic() -> Result<bool, String> // should emit lint
71 LL | | panic!("error");
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
82 error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
83 --> $DIR/panic_in_result_fn.rs:67:1
85 LL | / fn main() -> Result<(), String> {
86 LL | | todo!("finish main method");
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
95 LL | todo!("finish main method");
96 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
98 error: aborting due to 6 previous errors