]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | //! The Rust parser and macro expander. |
2 | //! | |
3 | //! # Note | |
4 | //! | |
5 | //! This API is completely unstable and subject to change. | |
6 | ||
1b1a35ee XL |
7 | #![doc( |
8 | html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/", | |
9 | test(attr(deny(warnings))) | |
10 | )] | |
5869c6ff | 11 | #![feature(box_patterns)] |
8faf50e0 | 12 | #![feature(crate_visibility_modifier)] |
94222f64 | 13 | #![feature(if_let_guard)] |
cdc7bbd5 | 14 | #![feature(iter_zip)] |
9fa01778 | 15 | #![feature(label_break_value)] |
0bf4aa26 | 16 | #![feature(nll)] |
17df50a5 | 17 | #![feature(min_specialization)] |
dfeec247 | 18 | #![recursion_limit = "256"] |
1a4d82fc | 19 | |
3dfed10e | 20 | #[macro_use] |
f9f354fc XL |
21 | extern crate rustc_macros; |
22 | ||
970d7e83 | 23 | pub mod util { |
60c5eb7d XL |
24 | pub mod classify; |
25 | pub mod comments; | |
60c5eb7d | 26 | pub mod literal; |
92a42be0 | 27 | pub mod parser; |
970d7e83 | 28 | } |
223e47cc | 29 | |
223e47cc | 30 | pub mod ast; |
6a06907d | 31 | pub mod ast_like; |
1a4d82fc | 32 | pub mod attr; |
e9174d1e | 33 | pub mod entry; |
dfeec247 | 34 | pub mod expand; |
9fa01778 | 35 | pub mod mut_visit; |
74b04a01 | 36 | pub mod node_id; |
1a4d82fc | 37 | pub mod ptr; |
60c5eb7d | 38 | pub mod token; |
3157f602 | 39 | pub mod tokenstream; |
1a4d82fc | 40 | pub mod visit; |
223e47cc | 41 | |
3dfed10e | 42 | pub use self::ast::*; |
6a06907d | 43 | pub use self::ast_like::AstLike; |
3dfed10e | 44 | |
dfeec247 | 45 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
60c5eb7d XL |
46 | |
47 | /// Requirements for a `StableHashingContext` to be used in this crate. | |
48 | /// This is a hack to allow using the `HashStable_Generic` derive macro | |
cdc7bbd5 | 49 | /// instead of implementing everything in `rustc_middle`. |
dfeec247 XL |
50 | pub trait HashStableContext: rustc_span::HashStableContext { |
51 | fn hash_attr(&mut self, _: &ast::Attribute, hasher: &mut StableHasher); | |
52 | } | |
53 | ||
54 | impl<AstCtx: crate::HashStableContext> HashStable<AstCtx> for ast::Attribute { | |
55 | fn hash_stable(&self, hcx: &mut AstCtx, hasher: &mut StableHasher) { | |
56 | hcx.hash_attr(self, hasher) | |
57 | } | |
58 | } |