]> git.lizzy.rs Git - rust.git/blob - src/librustc_mir/lib.rs
Auto merge of #49371 - scottmcm:catch-wrapping, r=nikomatsakis
[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(const_fn)]
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)]
32 #![feature(nonzero)]
33 #![feature(inclusive_range_fields)]
34 #![feature(crate_visibility_modifier)]
35 #![cfg_attr(stage0, feature(try_trait))]
36
37 extern crate arena;
38 #[macro_use]
39 extern crate bitflags;
40 #[macro_use] extern crate log;
41 extern crate graphviz as dot;
42 #[macro_use]
43 extern crate rustc;
44 #[macro_use] extern crate rustc_data_structures;
45 extern crate serialize as rustc_serialize;
46 extern crate rustc_errors;
47 #[macro_use]
48 extern crate syntax;
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;
56
57 #[cfg(stage0)]
58 macro_rules! do_catch {
59   ($t:expr) => { (|| ::std::ops::Try::from_ok($t) )() }
60 }
61
62 #[cfg(not(stage0))]
63 macro_rules! do_catch {
64   ($t:expr) => { do catch { $t } }
65 }
66
67 mod diagnostics;
68
69 mod borrow_check;
70 mod build;
71 mod dataflow;
72 mod hair;
73 mod shim;
74 pub mod transform;
75 pub mod util;
76 pub mod interpret;
77 pub mod monomorphize;
78
79 pub use hair::pattern::check_crate as matchck_crate;
80 use rustc::ty::maps::Providers;
81
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;
88 }
89
90 __build_diagnostic_array! { librustc_mir, DIAGNOSTICS }