2020-01-05 15:46:44 +00:00
|
|
|
//! Construction of MIR from HIR.
|
2024-02-06 09:51:39 +11: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 20:40:08 +02:00
|
|
|
#![feature(let_chains)]
|
2022-12-23 21:02:23 +01:00
|
|
|
#![feature(try_blocks)]
|
2020-01-05 15:46:44 +00:00
|
|
|
|
|
|
|
mod build;
|
2021-03-14 20:10:22 +01:00
|
|
|
mod check_unsafety;
|
2022-08-20 14:28:43 +03:00
|
|
|
mod errors;
|
2023-07-20 21:01:27 +02: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-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) {
|
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 18:42:17 +02:00
|
|
|
providers.thir_body = thir::cx::thir_body;
|
2024-04-15 20:08:21 -04: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
|
|
|
}
|