rustc_ast/
lib.rs

1//! The Rust Abstract Syntax Tree (AST).
2//!
3//! # Note
4//!
5//! This API is completely unstable and subject to change.
6
7// tidy-alphabetical-start
8#![allow(internal_features)]
9#![doc(
10    html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
11    test(attr(deny(warnings)))
12)]
13#![doc(rust_logo)]
14#![feature(associated_type_defaults)]
15#![feature(box_patterns)]
16#![feature(if_let_guard)]
17#![feature(let_chains)]
18#![feature(negative_impls)]
19#![feature(never_type)]
20#![feature(rustdoc_internals)]
21#![feature(stmt_expr_attributes)]
22#![warn(unreachable_pub)]
23// tidy-alphabetical-end
24
25pub mod util {
26    pub mod case;
27    pub mod classify;
28    pub mod comments;
29    pub mod literal;
30    pub mod parser;
31    pub mod unicode;
32}
33
34pub mod ast;
35pub mod ast_traits;
36pub mod attr;
37pub mod entry;
38pub mod expand;
39pub mod format;
40pub mod mut_visit;
41pub mod node_id;
42pub mod ptr;
43pub mod token;
44pub mod tokenstream;
45pub mod visit;
46
47pub use self::ast::*;
48pub use self::ast_traits::{AstDeref, AstNodeWrapper, HasAttrs, HasNodeId, HasTokens};
49
50/// Requirements for a `StableHashingContext` to be used in this crate.
51/// This is a hack to allow using the `HashStable_Generic` derive macro
52/// instead of implementing everything in `rustc_middle`.
53pub trait HashStableContext: rustc_span::HashStableContext {}