]> git.lizzy.rs Git - rust.git/blob - src/test/ui/macros/trace_faulty_macros.rs
Rollup merge of #44562 - eddyb:ugh-rustdoc, r=nikomatsakis
[rust.git] / src / test / ui / macros / trace_faulty_macros.rs
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // compile-flags: -Z trace-macros
12
13 #![recursion_limit="4"]
14
15 macro_rules! my_faulty_macro {
16     () => {
17         my_faulty_macro!(bcd);
18     };
19 }
20
21 macro_rules! pat_macro {
22     () => {
23         pat_macro!(A{a:a, b:0, c:_, ..});
24     };
25     ($a:pat) => {
26         $a
27     };
28 }
29
30 macro_rules! my_recursive_macro {
31     () => {
32         my_recursive_macro!();
33     };
34 }
35
36 macro_rules! my_macro {
37     () => {
38
39     };
40 }
41
42 fn main() {
43     my_faulty_macro!();
44     my_recursive_macro!();
45     test!();
46     non_exisiting!();
47     derive!(Debug);
48     let a = pat_macro!();
49 }
50
51 #[my_macro]
52 fn use_bang_macro_as_attr(){}
53
54 #[derive(Debug)]
55 fn use_derive_macro_as_attr(){}