]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_mir/src/lib.rs
use RegionNameHighlight for async fn and closure returns
[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 #![recursion_limit = "256"]
31
32 #[macro_use]
33 extern crate tracing;
34 #[macro_use]
35 extern crate rustc_middle;
36
37 mod borrow_check;
38 pub mod const_eval;
39 pub mod dataflow;
40 pub mod interpret;
41 pub mod monomorphize;
42 mod shim;
43 pub mod transform;
44 pub mod util;
45
46 use rustc_middle::ty::query::Providers;
47
48 pub fn provide(providers: &mut Providers) {
49     borrow_check::provide(providers);
50     const_eval::provide(providers);
51     shim::provide(providers);
52     transform::provide(providers);
53     monomorphize::partitioning::provide(providers);
54     monomorphize::polymorphize::provide(providers);
55     providers.eval_to_const_value_raw = const_eval::eval_to_const_value_raw_provider;
56     providers.eval_to_allocation_raw = const_eval::eval_to_allocation_raw_provider;
57     providers.const_caller_location = const_eval::const_caller_location;
58     providers.destructure_const = |tcx, param_env_and_value| {
59         let (param_env, value) = param_env_and_value.into_parts();
60         const_eval::destructure_const(tcx, param_env, value)
61     };
62     providers.deref_const = |tcx, param_env_and_value| {
63         let (param_env, value) = param_env_and_value.into_parts();
64         const_eval::deref_const(tcx, param_env, value)
65     };
66 }