]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_mir/src/lib.rs
Rollup merge of #81932 - jyn514:rustdoc-logging, r=Mark-Simulacrum
[rust.git] / compiler / rustc_mir / src / lib.rs
1 /*!
2
3 Rust MIR: a lowered representation of Rust.
4
5 */
6
7 #![feature(nll)]
8 #![feature(in_band_lifetimes)]
9 #![feature(array_windows)]
10 #![feature(bindings_after_at)]
11 #![feature(bool_to_option)]
12 #![feature(box_patterns)]
13 #![feature(box_syntax)]
14 #![feature(const_fn)]
15 #![feature(const_panic)]
16 #![feature(crate_visibility_modifier)]
17 #![feature(decl_macro)]
18 #![feature(exact_size_is_empty)]
19 #![feature(exhaustive_patterns)]
20 #![feature(never_type)]
21 #![feature(min_specialization)]
22 #![feature(trusted_len)]
23 #![feature(try_blocks)]
24 #![feature(associated_type_defaults)]
25 #![feature(stmt_expr_attributes)]
26 #![feature(trait_alias)]
27 #![feature(option_expect_none)]
28 #![feature(or_patterns)]
29 #![feature(once_cell)]
30 #![feature(control_flow_enum)]
31 #![recursion_limit = "256"]
32
33 #[macro_use]
34 extern crate tracing;
35 #[macro_use]
36 extern crate rustc_middle;
37
38 mod borrow_check;
39 pub mod const_eval;
40 pub mod dataflow;
41 pub mod interpret;
42 pub mod monomorphize;
43 mod shim;
44 pub mod transform;
45 pub mod util;
46
47 use rustc_middle::ty::query::Providers;
48
49 pub fn provide(providers: &mut Providers) {
50     borrow_check::provide(providers);
51     const_eval::provide(providers);
52     shim::provide(providers);
53     transform::provide(providers);
54     monomorphize::partitioning::provide(providers);
55     monomorphize::polymorphize::provide(providers);
56     providers.eval_to_const_value_raw = const_eval::eval_to_const_value_raw_provider;
57     providers.eval_to_allocation_raw = const_eval::eval_to_allocation_raw_provider;
58     providers.const_caller_location = const_eval::const_caller_location;
59     providers.mir_callgraph_reachable = transform::inline::cycle::mir_callgraph_reachable;
60     providers.mir_inliner_callees = transform::inline::cycle::mir_inliner_callees;
61     providers.destructure_const = |tcx, param_env_and_value| {
62         let (param_env, value) = param_env_and_value.into_parts();
63         const_eval::destructure_const(tcx, param_env, value)
64     };
65     providers.deref_const = |tcx, param_env_and_value| {
66         let (param_env, value) = param_env_and_value.into_parts();
67         const_eval::deref_const(tcx, param_env, value)
68     };
69 }