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