2020-01-13 13:40:30 +01:00
|
|
|
//! Various checks
|
|
|
|
|
//!
|
|
|
|
|
//! # Note
|
|
|
|
|
//!
|
|
|
|
|
//! This API is completely unstable and subject to change.
|
|
|
|
|
|
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)]
|
2025-04-23 15:51:57 +02:00
|
|
|
#![cfg_attr(bootstrap, feature(let_chains))]
|
2020-09-23 21:51:56 +02:00
|
|
|
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
2023-11-13 07:39:17 -05:00
|
|
|
#![doc(rust_logo)]
|
2023-02-18 19:21:07 -08:00
|
|
|
#![feature(assert_matches)]
|
2023-07-14 11:56:16 +00:00
|
|
|
#![feature(associated_type_defaults)]
|
2023-11-16 18:33:36 +11:00
|
|
|
#![feature(box_patterns)]
|
|
|
|
|
#![feature(if_let_guard)]
|
2023-04-02 23:21:09 -07:00
|
|
|
#![feature(iterator_try_collect)]
|
2022-07-09 09:35:06 +00:00
|
|
|
#![feature(never_type)]
|
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
|
|
|
#![feature(rustdoc_internals)]
|
|
|
|
|
// tidy-alphabetical-end
|
2020-01-13 13:40:30 +01:00
|
|
|
|
2023-05-15 06:24:45 +02:00
|
|
|
use rustc_middle::query::Providers;
|
2020-01-13 13:40:30 +01:00
|
|
|
|
2022-10-02 19:06:14 -05:00
|
|
|
mod abi;
|
2021-11-18 21:44:45 +00:00
|
|
|
mod assoc;
|
2020-01-30 20:28:16 +00:00
|
|
|
mod common_traits;
|
2022-06-28 22:45:05 +02:00
|
|
|
mod consts;
|
2022-08-19 00:04:31 +01:00
|
|
|
mod errors;
|
2022-08-17 12:22:32 +02:00
|
|
|
mod implied_bounds;
|
2023-11-16 17:08:27 +11:00
|
|
|
mod instance;
|
2022-10-02 19:06:14 -05:00
|
|
|
mod layout;
|
2020-01-30 20:28:16 +00:00
|
|
|
mod needs_drop;
|
2025-05-02 16:24:28 +00:00
|
|
|
mod nested_bodies;
|
2023-04-18 16:09:48 +02:00
|
|
|
mod opaque_types;
|
2023-11-16 17:08:27 +11:00
|
|
|
mod representability;
|
2023-07-18 07:22:46 +00:00
|
|
|
pub mod sig_types;
|
2022-12-08 04:02:50 +00:00
|
|
|
mod structural_match;
|
2020-01-13 13:40:30 +01:00
|
|
|
mod ty;
|
|
|
|
|
|
2023-11-22 09:53:07 +11:00
|
|
|
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
2022-10-13 10:13:02 +01:00
|
|
|
|
2020-07-05 23:00:14 +03:00
|
|
|
pub fn provide(providers: &mut Providers) {
|
2022-10-02 19:06:14 -05:00
|
|
|
abi::provide(providers);
|
2021-11-18 21:44:45 +00:00
|
|
|
assoc::provide(providers);
|
2020-01-30 20:28:16 +00:00
|
|
|
common_traits::provide(providers);
|
2022-06-28 22:35:48 +02:00
|
|
|
consts::provide(providers);
|
2022-08-17 12:22:32 +02:00
|
|
|
implied_bounds::provide(providers);
|
2022-10-02 19:06:14 -05:00
|
|
|
layout::provide(providers);
|
2020-01-30 20:28:16 +00:00
|
|
|
needs_drop::provide(providers);
|
2023-04-18 16:09:48 +02:00
|
|
|
opaque_types::provide(providers);
|
2022-08-15 14:11:11 -05:00
|
|
|
representability::provide(providers);
|
2020-01-13 13:40:30 +01:00
|
|
|
ty::provide(providers);
|
2020-04-05 01:21:36 -04:00
|
|
|
instance::provide(providers);
|
2022-12-08 04:02:50 +00:00
|
|
|
structural_match::provide(providers);
|
2025-05-02 16:24:28 +00:00
|
|
|
nested_bodies::provide(providers);
|
2020-01-13 13:40:30 +01:00
|
|
|
}
|