1 //! The Rust parser and macro expander.
5 //! This API is completely unstable and subject to change.
7 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/", test(attr(deny(warnings))))]
8 #![feature(bool_to_option)]
9 #![feature(box_syntax)]
10 #![feature(const_fn)] // For the `transmute` in `P::new`
11 #![feature(const_panic)]
12 #![feature(const_fn_transmute)]
13 #![feature(crate_visibility_modifier)]
14 #![feature(label_break_value)]
16 #![feature(or_patterns)]
17 #![feature(try_trait)]
18 #![feature(unicode_internals)]
19 #![recursion_limit = "256"]
22 extern crate rustc_macros
;
25 macro_rules
! unwrap_or
{
26 ($opt
:expr
, $
default:expr
) => {
44 pub mod crate_disambiguator
;
56 use rustc_data_structures
::stable_hasher
::{HashStable, StableHasher}
;
58 /// Requirements for a `StableHashingContext` to be used in this crate.
59 /// This is a hack to allow using the `HashStable_Generic` derive macro
60 /// instead of implementing everything in librustc_middle.
61 pub trait HashStableContext
: rustc_span
::HashStableContext
{
62 fn hash_attr(&mut self, _
: &ast
::Attribute
, hasher
: &mut StableHasher
);
65 impl<AstCtx
: crate::HashStableContext
> HashStable
<AstCtx
> for ast
::Attribute
{
66 fn hash_stable(&self, hcx
: &mut AstCtx
, hasher
: &mut StableHasher
) {
67 hcx
.hash_attr(self, hasher
)