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