2020-01-05 15:46:44 +00:00
|
|
|
//! Construction of MIR from HIR.
|
2024-02-05 22:51:39 +00: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 03:49:36 +00:00
|
|
|
// tidy-alphabetical-start
|
2024-02-05 22:51:39 +00:00
|
|
|
#![allow(rustc::diagnostic_outside_of_impl)]
|
|
|
|
#![allow(rustc::untranslatable_diagnostic)]
|
2022-10-09 16:15:16 +00:00
|
|
|
#![feature(assert_matches)]
|
2020-01-05 15:46:44 +00:00
|
|
|
#![feature(box_patterns)]
|
2022-03-09 17:10:48 +00:00
|
|
|
#![feature(if_let_guard)]
|
2022-08-20 18:40:08 +00:00
|
|
|
#![feature(let_chains)]
|
2022-12-23 20:02:23 +00:00
|
|
|
#![feature(try_blocks)]
|
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-end
|
2020-01-05 15:46:44 +00:00
|
|
|
|
|
|
|
mod build;
|
2021-03-14 19:10:22 +00:00
|
|
|
mod check_unsafety;
|
2022-08-20 11:28:43 +00:00
|
|
|
mod errors;
|
2023-07-20 19:01:27 +00:00
|
|
|
pub mod lints;
|
2023-10-25 09:38:37 +00:00
|
|
|
mod thir;
|
2020-01-05 15:46:44 +00:00
|
|
|
|
2024-03-19 10:17:15 +00:00
|
|
|
use rustc_middle::util::Providers;
|
2020-01-05 15:46:44 +00:00
|
|
|
|
2023-11-21 22:53:07 +00:00
|
|
|
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
2022-10-13 09:13:02 +00:00
|
|
|
|
2020-07-05 20:00:14 +00:00
|
|
|
pub fn provide(providers: &mut Providers) {
|
2020-07-21 09:09:27 +00:00
|
|
|
providers.check_match = thir::pattern::check_match;
|
|
|
|
providers.lit_to_const = thir::constant::lit_to_const;
|
2024-03-19 10:17:15 +00:00
|
|
|
providers.hooks.build_mir = build::mir_build;
|
2023-06-18 07:55:04 +00:00
|
|
|
providers.closure_saved_names_of_captured_variables =
|
|
|
|
build::closure_saved_names_of_captured_variables;
|
2023-12-07 11:56:48 +00:00
|
|
|
providers.check_unsafety = check_unsafety::check_unsafety;
|
2021-04-04 16:42:17 +00:00
|
|
|
providers.thir_body = thir::cx::thir_body;
|
2024-04-16 00:08:21 +00:00
|
|
|
providers.hooks.thir_tree = thir::print::thir_tree;
|
|
|
|
providers.hooks.thir_flat = thir::print::thir_flat;
|
2020-01-05 15:46:44 +00:00
|
|
|
}
|