2020-03-05 18:07:42 -03:00
|
|
|
//! HIR datatypes. See the [rustc dev guide] for more info.
|
2020-01-02 05:18:45 +01:00
|
|
|
//!
|
2020-03-09 18:33:04 -03:00
|
|
|
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/hir.html
|
2020-01-02 05:18:45 +01:00
|
|
|
|
Use `tidy` to sort crate attributes for all compiler crates.
We already do this for a number of crates, e.g. `rustc_middle`,
`rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`.
For the ones we don't, in many cases the attributes are a mess.
- There is no consistency about order of attribute kinds (e.g.
`allow`/`deny`/`feature`).
- Within attribute kind groups (e.g. the `feature` attributes),
sometimes the order is alphabetical, and sometimes there is no
particular order.
- Sometimes the attributes of a particular kind aren't even grouped
all together, e.g. there might be a `feature`, then an `allow`, then
another `feature`.
This commit extends the existing sorting to all compiler crates,
increasing consistency. If any new attribute line is added there is now
only one place it can go -- no need for arbitrary decisions.
Exceptions:
- `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`,
because they have no crate attributes.
- `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's
ignored in `rustfmt.toml`).
2024-06-12 13:49:36 +10:00
|
|
|
// tidy-alphabetical-start
|
|
|
|
#![allow(internal_features)]
|
2021-11-03 18:03:12 -05:00
|
|
|
#![feature(associated_type_defaults)]
|
2025-01-28 22:22:26 +00:00
|
|
|
#![feature(box_patterns)]
|
2022-05-10 20:17:38 +09:00
|
|
|
#![feature(closure_track_caller)]
|
2025-01-23 18:48:16 +00:00
|
|
|
#![feature(debug_closure_helpers)]
|
2025-01-11 19:12:36 +00:00
|
|
|
#![feature(exhaustive_patterns)]
|
2022-11-05 22:41:07 +00:00
|
|
|
#![feature(let_chains)]
|
2021-09-12 03:19:18 +02:00
|
|
|
#![feature(never_type)]
|
2022-03-08 15:39:52 +01:00
|
|
|
#![feature(rustc_attrs)]
|
2022-10-26 16:18:46 -05:00
|
|
|
#![feature(variant_count)]
|
2024-08-27 12:59:20 +10:00
|
|
|
#![warn(unreachable_pub)]
|
Use `tidy` to sort crate attributes for all compiler crates.
We already do this for a number of crates, e.g. `rustc_middle`,
`rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`.
For the ones we don't, in many cases the attributes are a mess.
- There is no consistency about order of attribute kinds (e.g.
`allow`/`deny`/`feature`).
- Within attribute kind groups (e.g. the `feature` attributes),
sometimes the order is alphabetical, and sometimes there is no
particular order.
- Sometimes the attributes of a particular kind aren't even grouped
all together, e.g. there might be a `feature`, then an `allow`, then
another `feature`.
This commit extends the existing sorting to all compiler crates,
increasing consistency. If any new attribute line is added there is now
only one place it can go -- no need for arbitrary decisions.
Exceptions:
- `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`,
because they have no crate attributes.
- `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's
ignored in `rustfmt.toml`).
2024-06-12 13:49:36 +10:00
|
|
|
// tidy-alphabetical-end
|
2020-01-02 09:53:15 +01:00
|
|
|
|
2021-07-13 18:45:20 +02:00
|
|
|
extern crate self as rustc_hir;
|
|
|
|
|
2020-03-21 02:21:21 +01:00
|
|
|
mod arena;
|
2020-01-02 05:18:45 +01:00
|
|
|
pub mod def;
|
2021-07-20 13:54:37 +02:00
|
|
|
pub mod def_path_hash_map;
|
2020-03-21 04:39:48 +01:00
|
|
|
pub mod definitions;
|
2021-10-04 15:57:39 -05:00
|
|
|
pub mod diagnostic_items;
|
2020-02-08 15:06:31 -05:00
|
|
|
pub use rustc_span::def_id;
|
2020-01-02 05:18:45 +01:00
|
|
|
mod hir;
|
2019-12-25 15:26:30 +01:00
|
|
|
pub mod hir_id;
|
2020-01-07 17:30:29 +01:00
|
|
|
pub mod intravisit;
|
2020-01-30 01:24:51 +01:00
|
|
|
pub mod lang_items;
|
2020-01-02 05:18:45 +01:00
|
|
|
pub mod pat_util;
|
|
|
|
mod stable_hash_impls;
|
2020-01-30 01:24:51 +01:00
|
|
|
mod target;
|
|
|
|
pub mod weak_lang_items;
|
|
|
|
|
2021-02-04 11:04:29 +01:00
|
|
|
#[cfg(test)]
|
|
|
|
mod tests;
|
|
|
|
|
2024-09-20 21:49:37 +08:00
|
|
|
#[doc(no_inline)]
|
2020-01-02 05:18:45 +01:00
|
|
|
pub use hir::*;
|
2019-12-25 15:26:30 +01:00
|
|
|
pub use hir_id::*;
|
2020-01-30 01:24:51 +01:00
|
|
|
pub use lang_items::{LangItem, LanguageItems};
|
2020-01-02 05:18:45 +01:00
|
|
|
pub use stable_hash_impls::HashStableContext;
|
2020-01-30 01:24:51 +01:00
|
|
|
pub use target::{MethodKind, Target};
|
2021-07-13 18:45:20 +02:00
|
|
|
|
|
|
|
arena_types!(rustc_arena::declare_arena);
|