]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_mir/src/lib.rs
fix feature use in rustc libs
[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(assert_matches)]
11 #![feature(bindings_after_at)]
12 #![feature(bool_to_option)]
13 #![feature(box_patterns)]
14 #![feature(box_syntax)]
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(iter_zip)]
21 #![feature(never_type)]
22 #![feature(map_try_insert)]
23 #![feature(min_specialization)]
24 #![feature(trusted_len)]
25 #![feature(try_blocks)]
26 #![feature(associated_type_defaults)]
27 #![feature(stmt_expr_attributes)]
28 #![feature(trait_alias)]
29 #![feature(option_get_or_insert_default)]
30 #![cfg_attr(bootstrap, feature(or_patterns))]
31 #![feature(once_cell)]
32 #![feature(control_flow_enum)]
33 #![recursion_limit = "256"]
34
35 #[macro_use]
36 extern crate tracing;
37 #[macro_use]
38 extern crate rustc_middle;
39
40 mod borrow_check;
41 pub mod const_eval;
42 pub mod dataflow;
43 pub mod interpret;
44 pub mod monomorphize;
45 mod shim;
46 pub mod transform;
47 pub mod util;
48
49 use rustc_middle::ty::query::Providers;
50
51 pub fn provide(providers: &mut Providers) {
52     borrow_check::provide(providers);
53     const_eval::provide(providers);
54     shim::provide(providers);
55     transform::provide(providers);
56     monomorphize::partitioning::provide(providers);
57     monomorphize::polymorphize::provide(providers);
58     providers.eval_to_const_value_raw = const_eval::eval_to_const_value_raw_provider;
59     providers.eval_to_allocation_raw = const_eval::eval_to_allocation_raw_provider;
60     providers.const_caller_location = const_eval::const_caller_location;
61     providers.mir_callgraph_reachable = transform::inline::cycle::mir_callgraph_reachable;
62     providers.mir_inliner_callees = transform::inline::cycle::mir_inliner_callees;
63     providers.destructure_const = |tcx, param_env_and_value| {
64         let (param_env, value) = param_env_and_value.into_parts();
65         const_eval::destructure_const(tcx, param_env, value)
66     };
67     providers.const_to_valtree = |tcx, param_env_and_value| {
68         let (param_env, raw) = param_env_and_value.into_parts();
69         const_eval::const_to_valtree(tcx, param_env, raw)
70     };
71     providers.deref_const = |tcx, param_env_and_value| {
72         let (param_env, value) = param_env_and_value.into_parts();
73         const_eval::deref_const(tcx, param_env, value)
74     };
75 }