]> git.lizzy.rs Git - rust.git/blob - src/librustc_expand/lib.rs
Rollup merge of #68039 - euclio:remove-strip-hidden, r=dtolnay
[rust.git] / src / librustc_expand / lib.rs
1 #![feature(crate_visibility_modifier)]
2 #![feature(decl_macro)]
3 #![feature(proc_macro_diagnostic)]
4 #![feature(proc_macro_internals)]
5 #![feature(proc_macro_span)]
6
7 extern crate proc_macro as pm;
8
9 // A variant of 'try!' that panics on an Err. This is used as a crutch on the
10 // way towards a non-panic!-prone parser. It should be used for fatal parsing
11 // errors; eventually we plan to convert all code using panictry to just use
12 // normal try.
13 #[macro_export]
14 macro_rules! panictry {
15     ($e:expr) => {{
16         use errors::FatalError;
17         use std::result::Result::{Err, Ok};
18         match $e {
19             Ok(e) => e,
20             Err(mut e) => {
21                 e.emit();
22                 FatalError.raise()
23             }
24         }
25     }};
26 }
27
28 mod placeholders;
29 mod proc_macro_server;
30
31 pub use mbe::macro_rules::compile_declarative_macro;
32 crate use rustc_span::hygiene;
33 pub mod base;
34 pub mod build;
35 pub mod expand;
36 pub use rustc_parse::config;
37 pub mod proc_macro;
38
39 crate mod mbe;
40
41 // HACK(Centril, #64197): These shouldn't really be here.
42 // Rather, they should be with their respective modules which are defined in other crates.
43 // However, since for now constructing a `ParseSess` sorta requires `config` from this crate,
44 // these tests will need to live here in the iterim.
45
46 #[cfg(test)]
47 mod tests;
48 #[cfg(test)]
49 mod parse {
50     #[cfg(test)]
51     mod tests;
52     #[cfg(test)]
53     mod lexer {
54         #[cfg(test)]
55         mod tests;
56     }
57 }
58 #[cfg(test)]
59 mod tokenstream {
60     #[cfg(test)]
61     mod tests;
62 }
63 #[cfg(test)]
64 mod mut_visit {
65     #[cfg(test)]
66     mod tests;
67 }