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#![cfg_attr(doc, recursion_limit = "256")] // FIXME(nnethercote): will be removed by #124141
10#![doc(
11    html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
12    test(attr(deny(warnings)))
13)]
14#![doc(rust_logo)]
15#![feature(associated_type_defaults)]
16#![feature(box_patterns)]
17#![feature(if_let_guard)]
18#![feature(let_chains)]
19#![feature(negative_impls)]
20#![feature(never_type)]
21#![feature(rustdoc_internals)]
22#![feature(stmt_expr_attributes)]
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 {}