2015-08-18 17:59:21 -04:00
|
|
|
/*!
|
|
|
|
|
|
|
|
Rust MIR: a lowered representation of Rust. Also: an experiment!
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2019-02-08 19:56:52 +09:00
|
|
|
#![feature(nll)]
|
2018-07-26 06:54:31 +03:00
|
|
|
#![feature(in_band_lifetimes)]
|
2019-10-08 01:14:42 +01:00
|
|
|
#![feature(bool_to_option)]
|
2016-02-11 18:05:28 +02:00
|
|
|
#![feature(box_patterns)]
|
2017-02-07 22:46:21 +01:00
|
|
|
#![feature(box_syntax)]
|
2018-04-06 15:18:01 -04:00
|
|
|
#![feature(crate_visibility_modifier)]
|
2019-10-16 18:01:01 -07:00
|
|
|
#![feature(drain_filter)]
|
2018-01-21 16:44:41 +08:00
|
|
|
#![feature(exhaustive_patterns)]
|
2019-11-10 10:26:33 +01:00
|
|
|
#![feature(iter_order_by)]
|
2019-12-11 09:55:29 -05:00
|
|
|
#![feature(never_type)]
|
2018-05-01 10:49:11 -04:00
|
|
|
#![feature(specialization)]
|
2019-05-26 09:55:50 +01:00
|
|
|
#![feature(trusted_len)]
|
2019-02-08 20:08:08 +09:00
|
|
|
#![feature(try_blocks)]
|
2019-07-31 21:00:35 +02:00
|
|
|
#![feature(associated_type_bounds)]
|
2019-09-17 16:25:29 -07:00
|
|
|
#![feature(range_is_empty)]
|
2019-09-26 07:06:00 +10:00
|
|
|
#![feature(stmt_expr_attributes)]
|
2019-11-24 19:09:58 -05:00
|
|
|
#![feature(trait_alias)]
|
2019-12-22 17:42:04 -05:00
|
|
|
#![recursion_limit = "256"]
|
2015-08-18 17:59:21 -04:00
|
|
|
|
2019-12-22 17:42:04 -05:00
|
|
|
#[macro_use]
|
|
|
|
extern crate log;
|
|
|
|
#[macro_use]
|
|
|
|
extern crate rustc;
|
2015-08-18 17:59:21 -04:00
|
|
|
|
2017-08-21 10:24:12 +02:00
|
|
|
mod borrow_check;
|
2019-12-22 17:42:04 -05:00
|
|
|
pub mod const_eval;
|
2019-09-06 14:31:09 +09:00
|
|
|
pub mod dataflow;
|
2019-12-22 17:42:04 -05:00
|
|
|
pub mod interpret;
|
|
|
|
pub mod monomorphize;
|
2017-02-07 22:46:21 +01:00
|
|
|
mod shim;
|
2015-11-10 21:38:36 +01:00
|
|
|
pub mod transform;
|
2017-03-09 20:10:05 +02:00
|
|
|
pub mod util;
|
2016-09-15 18:18:40 -07:00
|
|
|
|
2018-06-13 16:44:43 +03:00
|
|
|
use rustc::ty::query::Providers;
|
2017-02-20 03:55:28 +02:00
|
|
|
|
2019-02-08 06:28:15 +09:00
|
|
|
pub fn provide(providers: &mut Providers<'_>) {
|
2017-08-21 10:24:12 +02:00
|
|
|
borrow_check::provide(providers);
|
2020-01-01 18:06:00 +01:00
|
|
|
const_eval::provide(providers);
|
2017-02-08 18:31:03 +01:00
|
|
|
shim::provide(providers);
|
2017-04-27 16:48:48 -04:00
|
|
|
transform::provide(providers);
|
2018-10-25 14:49:51 +02:00
|
|
|
monomorphize::partitioning::provide(providers);
|
2019-11-30 08:42:56 +13:00
|
|
|
providers.const_eval_validated = const_eval::const_eval_validated_provider;
|
2018-08-26 15:19:34 +02:00
|
|
|
providers.const_eval_raw = const_eval::const_eval_raw_provider;
|
2019-10-24 17:35:02 -07:00
|
|
|
providers.const_caller_location = const_eval::const_caller_location;
|
2019-05-24 14:58:37 -05:00
|
|
|
providers.const_field = |tcx, param_env_and_value| {
|
|
|
|
let (param_env, (value, field)) = param_env_and_value.into_parts();
|
|
|
|
const_eval::const_field(tcx, param_env, None, field, value)
|
|
|
|
};
|
2020-01-05 15:46:44 +00:00
|
|
|
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)
|
2020-01-11 15:22:36 +13:00
|
|
|
};
|
2017-03-14 12:22:38 -07:00
|
|
|
}
|