1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 Rust MIR: a lowered representation of Rust. Also: an experiment!
17 #![feature(slice_patterns)]
18 #![feature(slice_sort_by_cached_key)]
20 #![feature(box_patterns)]
21 #![feature(box_syntax)]
22 #![feature(catch_expr)]
24 #![feature(core_intrinsics)]
25 #![feature(decl_macro)]
26 #![feature(dyn_trait)]
27 #![feature(fs_read_write)]
28 #![feature(macro_vis_matcher)]
29 #![feature(exhaustive_patterns)]
30 #![feature(range_contains)]
31 #![feature(rustc_diagnostic_macros)]
33 #![feature(inclusive_range_fields)]
34 #![feature(crate_visibility_modifier)]
35 #![cfg_attr(stage0, feature(try_trait))]
39 extern crate bitflags;
40 #[macro_use] extern crate log;
41 extern crate graphviz as dot;
44 #[macro_use] extern crate rustc_data_structures;
45 extern crate serialize as rustc_serialize;
46 extern crate rustc_errors;
49 extern crate syntax_pos;
50 extern crate rustc_back;
51 extern crate rustc_const_math;
52 extern crate core; // for NonZero
53 extern crate log_settings;
54 extern crate rustc_apfloat;
55 extern crate byteorder;
58 macro_rules! do_catch {
59 ($t:expr) => { (|| ::std::ops::Try::from_ok($t) )() }
63 macro_rules! do_catch {
64 ($t:expr) => { do catch { $t } }
79 pub use hair::pattern::check_crate as matchck_crate;
80 use rustc::ty::maps::Providers;
82 pub fn provide(providers: &mut Providers) {
83 borrow_check::provide(providers);
84 shim::provide(providers);
85 transform::provide(providers);
86 providers.const_eval = interpret::const_eval_provider;
87 providers.check_match = hair::pattern::check_match;
90 __build_diagnostic_array! { librustc_mir, DIAGNOSTICS }