Skip to main content

rustc_mir_build/
lib.rs

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