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)]
|
2024-08-29 00:13:19 +00: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 03:49:36 +00:00
|
|
|
// tidy-alphabetical-end
|
2020-01-05 15:46:44 +00:00
|
|
|
|
2024-12-16 04:27:06 +00:00
|
|
|
// The `builder` module used to be named `build`, but that was causing GitHub's
|
|
|
|
// "Go to file" feature to silently ignore all files in the module, probably
|
|
|
|
// because it assumes that "build" is a build-output directory. See #134365.
|
2024-12-16 01:44:54 +00:00
|
|
|
mod builder;
|
2023-05-11 11:43:09 +00:00
|
|
|
mod check_tail_calls;
|
2021-03-14 19:10:22 +00:00
|
|
|
mod check_unsafety;
|
2022-08-20 11:28:43 +00:00
|
|
|
mod errors;
|
2025-01-31 03:42:19 +00:00
|
|
|
pub 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;
|
2025-01-18 21:25:31 +00:00
|
|
|
providers.hooks.build_mir = builder::build_mir;
|
2023-06-18 07:55:04 +00:00
|
|
|
providers.closure_saved_names_of_captured_variables =
|
2024-12-16 01:44:54 +00:00
|
|
|
builder::closure_saved_names_of_captured_variables;
|
2023-12-07 11:56:48 +00:00
|
|
|
providers.check_unsafety = check_unsafety::check_unsafety;
|
2023-05-11 11:43:09 +00:00
|
|
|
providers.check_tail_calls = check_tail_calls::check_tail_calls;
|
2021-04-04 16:42:17 +00:00
|
|
|
providers.thir_body = thir::cx::thir_body;
|
2020-01-05 15:46:44 +00:00
|
|
|
}
|