]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/must_use_unit.fixed
New upstream version 1.74.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / must_use_unit.fixed
1 //@aux-build:proc_macros.rs
2
3 #![warn(clippy::must_use_unit)]
4 #![allow(clippy::unused_unit)]
5
6 extern crate proc_macros;
7 use proc_macros::external;
8
9
10 pub fn must_use_default() {}
11
12
13 pub fn must_use_unit() -> () {}
14
15
16 pub fn must_use_with_note() {}
17
18 fn main() {
19 must_use_default();
20 must_use_unit();
21 must_use_with_note();
22
23 // We should not lint in external macros
24 external!(
25 #[must_use]
26 fn foo() {}
27 );
28 }