]> git.lizzy.rs Git - rust.git/blob - src/librustc_mir/lib.rs
75b7a10097df4e0b5ac9f544b33134f067227b90
[rust.git] / src / librustc_mir / lib.rs
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.
4 //
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.
10
11 /*!
12
13 Rust MIR: a lowered representation of Rust. Also: an experiment!
14
15 */
16
17 #![feature(slice_patterns)]
18 #![feature(slice_sort_by_cached_key)]
19 #![feature(from_ref)]
20 #![feature(box_patterns)]
21 #![feature(box_syntax)]
22 #![feature(catch_expr)]
23 #![feature(crate_visibility_modifier)]
24 #![feature(const_fn)]
25 #![feature(core_intrinsics)]
26 #![feature(decl_macro)]
27 #![cfg_attr(stage0, feature(dyn_trait))]
28 #![feature(fs_read_write)]
29 #![feature(macro_vis_matcher)]
30 #![feature(exhaustive_patterns)]
31 #![feature(range_contains)]
32 #![feature(rustc_diagnostic_macros)]
33 #![feature(nonzero)]
34 #![feature(inclusive_range_fields)]
35 #![feature(crate_visibility_modifier)]
36 #![feature(never_type)]
37 #![cfg_attr(stage0, feature(try_trait))]
38
39 extern crate arena;
40 #[macro_use]
41 extern crate bitflags;
42 #[macro_use] extern crate log;
43 extern crate graphviz as dot;
44 #[macro_use]
45 extern crate rustc;
46 #[macro_use] extern crate rustc_data_structures;
47 extern crate serialize as rustc_serialize;
48 extern crate rustc_errors;
49 #[macro_use]
50 extern crate syntax;
51 extern crate syntax_pos;
52 extern crate rustc_target;
53 extern crate rustc_const_math;
54 extern crate core; // for NonZero
55 extern crate log_settings;
56 extern crate rustc_apfloat;
57 extern crate byteorder;
58
59 #[cfg(stage0)]
60 macro_rules! do_catch {
61   ($t:expr) => { (|| ::std::ops::Try::from_ok($t) )() }
62 }
63
64 #[cfg(not(stage0))]
65 macro_rules! do_catch {
66   ($t:expr) => { do catch { $t } }
67 }
68
69 mod diagnostics;
70
71 mod borrow_check;
72 mod build;
73 mod dataflow;
74 mod hair;
75 mod shim;
76 pub mod transform;
77 pub mod util;
78 pub mod interpret;
79 pub mod monomorphize;
80
81 pub use hair::pattern::check_crate as matchck_crate;
82 use rustc::ty::maps::Providers;
83
84 pub fn provide(providers: &mut Providers) {
85     borrow_check::provide(providers);
86     shim::provide(providers);
87     transform::provide(providers);
88     providers.const_eval = interpret::const_eval_provider;
89     providers.check_match = hair::pattern::check_match;
90 }
91
92 __build_diagnostic_array! { librustc_mir, DIAGNOSTICS }