]> git.lizzy.rs Git - rust.git/blob - tests/ui/double_must_use.rs
`assertions_on_result_states` fix suggestion when `assert!` not in a statement
[rust.git] / tests / ui / double_must_use.rs
1 #![warn(clippy::double_must_use)]
2 #![allow(clippy::result_unit_err)]
3
4 #[must_use]
5 pub fn must_use_result() -> Result<(), ()> {
6     unimplemented!();
7 }
8
9 #[must_use]
10 pub fn must_use_tuple() -> (Result<(), ()>, u8) {
11     unimplemented!();
12 }
13
14 #[must_use]
15 pub fn must_use_array() -> [Result<(), ()>; 1] {
16     unimplemented!();
17 }
18
19 #[must_use = "With note"]
20 pub fn must_use_with_note() -> Result<(), ()> {
21     unimplemented!();
22 }
23
24 fn main() {
25     must_use_result();
26     must_use_tuple();
27     must_use_with_note();
28 }