2020-01-11 12:15:20 +00:00
|
|
|
//! Functions and types dealing with attributes and meta items.
|
|
|
|
//!
|
2020-02-29 17:37:32 +00:00
|
|
|
//! FIXME(Centril): For now being, much of the logic is still in `rustc_ast::attr`.
|
2020-01-11 12:15:20 +00:00
|
|
|
//! The goal is to move the definition of `MetaItem` and things that don't need to be in `syntax`
|
|
|
|
//! to this crate.
|
|
|
|
|
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 03:49:36 +00:00
|
|
|
// tidy-alphabetical-start
|
2023-11-13 12:39:17 +00:00
|
|
|
#![allow(internal_features)]
|
|
|
|
#![doc(rust_logo)]
|
2022-08-20 18:40:08 +00:00
|
|
|
#![feature(let_chains)]
|
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 03:49:36 +00:00
|
|
|
#![feature(rustdoc_internals)]
|
|
|
|
// tidy-alphabetical-end
|
2022-02-02 11:45:20 +00:00
|
|
|
|
2020-01-11 12:15:20 +00:00
|
|
|
mod builtin;
|
2022-08-21 06:46:05 +00:00
|
|
|
mod session_diagnostics;
|
2020-01-11 12:15:20 +00:00
|
|
|
|
|
|
|
pub use builtin::*;
|
|
|
|
pub use IntType::*;
|
|
|
|
pub use ReprAttr::*;
|
|
|
|
pub use StabilityLevel::*;
|
|
|
|
|
2020-02-29 17:37:32 +00:00
|
|
|
pub use rustc_ast::attr::*;
|
2020-01-11 12:15:20 +00:00
|
|
|
|
2023-10-27 00:18:21 +00:00
|
|
|
pub(crate) use rustc_session::HashStableContext;
|
2022-10-13 09:13:02 +00:00
|
|
|
|
2023-11-21 22:53:07 +00:00
|
|
|
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|