3 Rust MIR: a lowered representation of Rust.
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)]
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(map_try_insert)]
22 #![feature(min_specialization)]
23 #![feature(trusted_len)]
24 #![feature(try_blocks)]
25 #![feature(associated_type_defaults)]
26 #![feature(stmt_expr_attributes)]
27 #![feature(trait_alias)]
28 #![feature(option_get_or_insert_default)]
29 #![feature(or_patterns)]
30 #![feature(once_cell)]
31 #![feature(control_flow_enum)]
32 #![recursion_limit = "256"]
37 extern crate rustc_middle
;
48 use rustc_middle
::ty
::query
::Providers
;
50 pub fn provide(providers
: &mut Providers
) {
51 borrow_check
::provide(providers
);
52 const_eval
::provide(providers
);
53 shim
::provide(providers
);
54 transform
::provide(providers
);
55 monomorphize
::partitioning
::provide(providers
);
56 monomorphize
::polymorphize
::provide(providers
);
57 providers
.eval_to_const_value_raw
= const_eval
::eval_to_const_value_raw_provider
;
58 providers
.eval_to_allocation_raw
= const_eval
::eval_to_allocation_raw_provider
;
59 providers
.const_caller_location
= const_eval
::const_caller_location
;
60 providers
.mir_callgraph_reachable
= transform
::inline
::cycle
::mir_callgraph_reachable
;
61 providers
.mir_inliner_callees
= transform
::inline
::cycle
::mir_inliner_callees
;
62 providers
.destructure_const
= |tcx
, param_env_and_value
| {
63 let (param_env
, value
) = param_env_and_value
.into_parts();
64 const_eval
::destructure_const(tcx
, param_env
, value
)
66 providers
.const_to_valtree
= |tcx
, param_env_and_value
| {
67 let (param_env
, raw
) = param_env_and_value
.into_parts();
68 const_eval
::const_to_valtree(tcx
, param_env
, raw
)
70 providers
.deref_const
= |tcx
, param_env_and_value
| {
71 let (param_env
, value
) = param_env_and_value
.into_parts();
72 const_eval
::deref_const(tcx
, param_env
, value
)