]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/must_use_unit.rs
Rollup merge of #71737 - RalfJung:miri-test-threads, r=shepmaster
[rust.git] / src / tools / clippy / tests / ui / must_use_unit.rs
1 //run-rustfix
2 // aux-build:macro_rules.rs
3
4 #![warn(clippy::must_use_unit)]
5 #![allow(clippy::unused_unit)]
6
7 #[macro_use]
8 extern crate macro_rules;
9
10 #[must_use]
11 pub fn must_use_default() {}
12
13 #[must_use]
14 pub fn must_use_unit() -> () {}
15
16 #[must_use = "With note"]
17 pub fn must_use_with_note() {}
18
19 fn main() {
20     must_use_default();
21     must_use_unit();
22     must_use_with_note();
23
24     // We should not lint in external macros
25     must_use_unit!();
26 }