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
|
|
|
|
|
|
|
*/
|
|
|
|
|
2021-03-04 12:06:01 +00:00
|
|
|
#![feature(assert_matches)]
|
2021-05-15 01:27:44 +00:00
|
|
|
#![cfg_attr(bootstrap, 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)]
|
2020-12-30 17:48:40 +00:00
|
|
|
#![feature(control_flow_enum)]
|
2018-04-06 19:18:01 +00:00
|
|
|
#![feature(crate_visibility_modifier)]
|
2020-04-27 17:01:30 +00:00
|
|
|
#![feature(decl_macro)]
|
2020-08-28 06:02:46 +00:00
|
|
|
#![feature(exact_size_is_empty)]
|
2020-12-30 17:48:40 +00:00
|
|
|
#![feature(in_band_lifetimes)]
|
2021-03-08 23:32:41 +00:00
|
|
|
#![feature(iter_zip)]
|
2021-03-04 12:06:01 +00:00
|
|
|
#![feature(map_try_insert)]
|
2020-05-09 11:59:21 +00:00
|
|
|
#![feature(min_specialization)]
|
2021-05-16 16:53:20 +00:00
|
|
|
#![feature(slice_ptr_get)]
|
2021-03-10 14:48:09 +00:00
|
|
|
#![feature(option_get_or_insert_default)]
|
2020-12-30 17:48:40 +00:00
|
|
|
#![feature(never_type)]
|
|
|
|
#![feature(trait_alias)]
|
|
|
|
#![feature(trusted_len)]
|
|
|
|
#![feature(trusted_step)]
|
|
|
|
#![feature(try_blocks)]
|
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
|
|
|
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod const_eval;
|
|
|
|
pub mod interpret;
|
2015-11-10 20:38:36 +00:00
|
|
|
pub mod transform;
|
2017-03-09 18:10:05 +00:00
|
|
|
pub mod util;
|
2016-09-16 01:18:40 +00:00
|
|
|
|
2020-03-29 14:41:09 +00:00
|
|
|
use rustc_middle::ty::query::Providers;
|
2017-02-20 01:55:28 +00:00
|
|
|
|
2020-07-05 20:00:14 +00:00
|
|
|
pub fn provide(providers: &mut Providers) {
|
2020-01-01 17:06:00 +00:00
|
|
|
const_eval::provide(providers);
|
2020-09-19 08:57:14 +00:00
|
|
|
providers.eval_to_const_value_raw = const_eval::eval_to_const_value_raw_provider;
|
2020-08-20 16:55:07 +00:00
|
|
|
providers.eval_to_allocation_raw = const_eval::eval_to_allocation_raw_provider;
|
2019-10-25 00:35:02 +00:00
|
|
|
providers.const_caller_location = const_eval::const_caller_location;
|
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 02:22:36 +00:00
|
|
|
};
|
2021-02-22 14:09:24 +00:00
|
|
|
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)
|
|
|
|
};
|
2020-07-01 09:41:38 +00:00
|
|
|
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)
|
|
|
|
};
|
2017-03-14 19:22:38 +00:00
|
|
|
}
|