]> git.lizzy.rs Git - rust.git/blob - src/test/ui/proc_macro.rs
Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726
[rust.git] / src / test / ui / proc_macro.rs
1 // run-pass
2 // aux-build:proc_macro_def.rs
3 // ignore-cross-compile
4
5 extern crate proc_macro_def;
6
7 use proc_macro_def::{attr_tru, attr_identity, identity, ret_tru, tru};
8
9 #[attr_tru]
10 fn f1() -> bool {
11     return false;
12 }
13
14 #[attr_identity]
15 fn f2() -> bool {
16     return identity!(true);
17 }
18
19 fn f3() -> identity!(bool) {
20     ret_tru!();
21 }
22
23 fn f4(x: bool) -> bool {
24     match x {
25         identity!(true) => false,
26         identity!(false) => true,
27     }
28 }
29
30 fn main() {
31     assert!(f1());
32     assert!(f2());
33     assert!(tru!());
34     assert!(f3());
35     assert!(identity!(5 == 5));
36     assert!(f4(false));
37 }