rustc_mir_build/
lib.rs

1//! Construction of MIR from HIR.
2
3// tidy-alphabetical-start
4#![allow(rustc::diagnostic_outside_of_impl)]
5#![allow(rustc::untranslatable_diagnostic)]
6#![cfg_attr(bootstrap, feature(let_chains))]
7#![feature(assert_matches)]
8#![feature(box_patterns)]
9#![feature(if_let_guard)]
10#![feature(try_blocks)]
11// tidy-alphabetical-end
12
13// The `builder` module used to be named `build`, but that was causing GitHub's
14// "Go to file" feature to silently ignore all files in the module, probably
15// because it assumes that "build" is a build-output directory. See #134365.
16pub mod builder;
17mod check_tail_calls;
18mod check_unsafety;
19mod errors;
20pub mod thir;
21
22use rustc_middle::util::Providers;
23
24rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
25
26pub fn provide(providers: &mut Providers) {
27    providers.check_match = thir::pattern::check_match;
28    providers.lit_to_const = thir::constant::lit_to_const;
29    providers.closure_saved_names_of_captured_variables =
30        builder::closure_saved_names_of_captured_variables;
31    providers.check_unsafety = check_unsafety::check_unsafety;
32    providers.check_tail_calls = check_tail_calls::check_tail_calls;
33    providers.thir_body = thir::cx::thir_body;
34}