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)]
|
2017-12-27 21:32:01 +01:00
|
|
|
#![feature(slice_patterns)]
|
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)]
|
2017-12-06 09:25:29 +01:00
|
|
|
#![feature(core_intrinsics)]
|
2018-09-06 15:33:54 -04:00
|
|
|
#![feature(const_fn)]
|
2017-12-06 09:25:29 +01:00
|
|
|
#![feature(decl_macro)]
|
2018-01-21 16:44:41 +08:00
|
|
|
#![feature(exhaustive_patterns)]
|
2016-05-07 19:14:28 +03:00
|
|
|
#![feature(rustc_diagnostic_macros)]
|
2018-09-07 15:28:23 +02:00
|
|
|
#![feature(rustc_attrs)]
|
2018-04-21 02:48:56 +08:00
|
|
|
#![feature(never_type)]
|
2018-05-01 10:49:11 -04:00
|
|
|
#![feature(specialization)]
|
2018-05-10 12:02:19 -06:00
|
|
|
#![feature(try_trait)]
|
2018-07-10 22:58:43 -07:00
|
|
|
#![feature(unicode_internals)]
|
2018-07-22 17:20:48 +03:00
|
|
|
#![feature(step_trait)]
|
2018-08-07 01:02:39 -07:00
|
|
|
#![feature(slice_concat_ext)]
|
2019-05-26 09:55:50 +01:00
|
|
|
#![feature(trusted_len)]
|
2019-02-08 20:08:08 +09:00
|
|
|
#![feature(try_blocks)]
|
2015-08-18 17:59:21 -04:00
|
|
|
|
2018-01-21 19:46:14 +01:00
|
|
|
#![recursion_limit="256"]
|
|
|
|
|
2019-02-08 06:28:15 +09:00
|
|
|
#![deny(rust_2018_idioms)]
|
2019-04-15 13:35:08 +02:00
|
|
|
#![deny(internal)]
|
2019-06-11 12:47:30 +03:00
|
|
|
#![deny(unused_lifetimes)]
|
2018-01-21 19:46:14 +01:00
|
|
|
|
2015-08-18 17:59:21 -04:00
|
|
|
#[macro_use] extern crate log;
|
2016-03-28 22:22:14 +02:00
|
|
|
#[macro_use]
|
2015-10-05 12:31:48 -04:00
|
|
|
extern crate rustc;
|
2017-12-06 09:25:29 +01:00
|
|
|
#[macro_use] extern crate rustc_data_structures;
|
2019-02-08 06:28:15 +09:00
|
|
|
#[allow(unused_extern_crates)]
|
|
|
|
extern crate serialize as rustc_serialize; // used by deriving
|
2016-05-07 19:14:28 +03:00
|
|
|
#[macro_use]
|
2015-10-05 12:31:48 -04:00
|
|
|
extern crate syntax;
|
2015-08-18 17:59:21 -04:00
|
|
|
|
2019-04-17 07:35:54 +09:00
|
|
|
mod error_codes;
|
2016-05-07 19:14:28 +03:00
|
|
|
|
2017-08-21 10:24:12 +02:00
|
|
|
mod borrow_check;
|
2017-05-01 18:44:25 -04:00
|
|
|
mod build;
|
2017-08-19 03:09:55 +03:00
|
|
|
mod dataflow;
|
2015-10-21 17:24:05 -04:00
|
|
|
mod hair;
|
2018-09-11 21:35:08 -04:00
|
|
|
mod lints;
|
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;
|
2017-12-14 11:36:28 +01:00
|
|
|
pub mod interpret;
|
2017-10-25 15:39:54 +02:00
|
|
|
pub mod monomorphize;
|
2018-08-24 16:39:25 +02:00
|
|
|
pub mod const_eval;
|
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);
|
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);
|
2018-09-20 10:17:14 +02:00
|
|
|
providers.const_eval = const_eval::const_eval_provider;
|
2018-08-26 15:19:34 +02:00
|
|
|
providers.const_eval_raw = const_eval::const_eval_raw_provider;
|
2018-01-26 16:12:07 +01:00
|
|
|
providers.check_match = hair::pattern::check_match;
|
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)
|
|
|
|
};
|
2019-06-02 23:20:36 -05:00
|
|
|
providers.type_name = interpret::type_name;
|
2017-03-14 12:22:38 -07:00
|
|
|
}
|
2017-07-30 23:22:09 -07:00
|
|
|
|
|
|
|
__build_diagnostic_array! { librustc_mir, DIAGNOSTICS }
|