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