rust/compiler/rustc_mir/src/lib.rs

76 lines
2.3 KiB
Rust
Raw Normal View History

2015-08-18 21:59:21 +00:00
/*!
2020-02-21 14:03:21 +00:00
Rust MIR: a lowered representation of Rust.
2015-08-18 21:59:21 +00:00
*/
2019-02-08 10:56:52 +00:00
#![feature(nll)]
#![feature(in_band_lifetimes)]
#![feature(array_windows)]
#![feature(assert_matches)]
#![feature(bindings_after_at)]
2019-10-08 00:14:42 +00:00
#![feature(bool_to_option)]
2016-02-11 16:05:28 +00:00
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(crate_visibility_modifier)]
#![feature(decl_macro)]
#![feature(exact_size_is_empty)]
#![feature(format_args_capture)]
2021-03-08 23:32:41 +00:00
#![feature(iter_zip)]
#![feature(never_type)]
#![feature(map_try_insert)]
#![feature(min_specialization)]
#![feature(slice_ptr_get)]
#![feature(trusted_len)]
2019-02-08 11:08:08 +00:00
#![feature(try_blocks)]
2020-03-22 19:09:40 +00:00
#![feature(associated_type_defaults)]
#![feature(stmt_expr_attributes)]
2019-11-25 00:09:58 +00:00
#![feature(trait_alias)]
2021-03-10 14:48:09 +00:00
#![feature(option_get_or_insert_default)]
#![feature(once_cell)]
#![feature(control_flow_enum)]
#![feature(try_reserve)]
2019-12-22 22:42:04 +00:00
#![recursion_limit = "256"]
2015-08-18 21:59:21 +00:00
2019-12-22 22:42:04 +00:00
#[macro_use]
2020-08-14 06:05:01 +00:00
extern crate tracing;
2019-12-22 22:42:04 +00:00
#[macro_use]
2020-03-29 14:41:09 +00:00
extern crate rustc_middle;
2015-08-18 21:59:21 +00:00
mod borrow_check;
2019-12-22 22:42:04 +00:00
pub mod const_eval;
2019-09-06 05:31:09 +00:00
pub mod dataflow;
2019-12-22 22:42:04 +00:00
pub mod interpret;
pub mod monomorphize;
mod shim;
pub mod transform;
pub mod util;
2020-03-29 14:41:09 +00:00
use rustc_middle::ty::query::Providers;
pub fn provide(providers: &mut Providers) {
borrow_check::provide(providers);
const_eval::provide(providers);
shim::provide(providers);
transform::provide(providers);
monomorphize::partitioning::provide(providers);
monomorphize::polymorphize::provide(providers);
providers.eval_to_const_value_raw = const_eval::eval_to_const_value_raw_provider;
providers.eval_to_allocation_raw = const_eval::eval_to_allocation_raw_provider;
providers.const_caller_location = const_eval::const_caller_location;
2020-12-29 16:21:52 +00:00
providers.mir_callgraph_reachable = transform::inline::cycle::mir_callgraph_reachable;
providers.mir_inliner_callees = transform::inline::cycle::mir_inliner_callees;
providers.destructure_const = |tcx, param_env_and_value| {
let (param_env, value) = param_env_and_value.into_parts();
const_eval::destructure_const(tcx, param_env, value)
};
providers.const_to_valtree = |tcx, param_env_and_value| {
let (param_env, raw) = param_env_and_value.into_parts();
const_eval::const_to_valtree(tcx, param_env, raw)
};
providers.deref_const = |tcx, param_env_and_value| {
let (param_env, value) = param_env_and_value.into_parts();
const_eval::deref_const(tcx, param_env, value)
};
}