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