]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/auxiliary/macro_use_helper.rs
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / auxiliary / macro_use_helper.rs
1 extern crate macro_rules;
2
3 // STMT
4 #[macro_export]
5 macro_rules! pub_macro {
6 () => {
7 let _ = "hello Mr. Vonnegut";
8 };
9 }
10
11 pub mod inner {
12 pub use super::*;
13
14 // RE-EXPORT
15 // this will stick in `inner` module
16 pub use macro_rules::foofoo;
17 pub use macro_rules::try_err;
18
19 pub mod nested {
20 pub use macro_rules::string_add;
21 }
22
23 // ITEM
24 #[macro_export]
25 macro_rules! inner_mod_macro {
26 () => {
27 #[allow(dead_code)]
28 pub struct Tardis;
29 };
30 }
31 }
32
33 // EXPR
34 #[macro_export]
35 macro_rules! function_macro {
36 () => {
37 if true {
38 } else {
39 }
40 };
41 }
42
43 // TYPE
44 #[macro_export]
45 macro_rules! ty_macro {
46 () => {
47 Vec<u8>
48 };
49 }
50
51 mod extern_exports {
52 pub(super) mod private_inner {
53 #[macro_export]
54 macro_rules! pub_in_private_macro {
55 ($name:ident) => {
56 let $name = String::from("secrets and lies");
57 };
58 }
59 }
60 }