3 Rust MIR: a lowered representation of Rust.
8 #![feature(in_band_lifetimes)]
9 #![feature(array_windows)]
10 #![feature(assert_matches)]
11 #![cfg_attr(bootstrap, feature(bindings_after_at))]
12 #![feature(bool_to_option)]
13 #![feature(box_patterns)]
14 #![feature(box_syntax)]
15 #![feature(crate_visibility_modifier)]
16 #![feature(decl_macro)]
17 #![feature(exact_size_is_empty)]
18 #![feature(format_args_capture)]
20 #![feature(never_type)]
21 #![feature(map_try_insert)]
22 #![feature(min_specialization)]
23 #![feature(slice_ptr_get)]
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 #![feature(once_cell)]
31 #![feature(control_flow_enum)]
32 #![feature(try_reserve)]
33 #![recursion_limit = "256"]
38 extern crate rustc_middle;
49 use rustc_middle::ty::query::Providers;
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)
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)
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)