]> git.lizzy.rs Git - rust.git/blob - src/librustc_mir/lib.rs
Rollup merge of #56910 - estebank:unclosed-eof, r=oli-obk
[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(nll)]
18 #![feature(in_band_lifetimes)]
19 #![feature(slice_patterns)]
20 #![feature(slice_sort_by_cached_key)]
21 #![feature(box_patterns)]
22 #![feature(box_syntax)]
23 #![feature(crate_visibility_modifier)]
24 #![feature(core_intrinsics)]
25 #![feature(const_fn)]
26 #![feature(decl_macro)]
27 #![feature(exhaustive_patterns)]
28 #![feature(range_contains)]
29 #![feature(rustc_diagnostic_macros)]
30 #![feature(rustc_attrs)]
31 #![feature(never_type)]
32 #![feature(specialization)]
33 #![feature(try_trait)]
34 #![feature(unicode_internals)]
35 #![feature(step_trait)]
36 #![feature(slice_concat_ext)]
37 #![feature(if_while_or_patterns)]
38 #![feature(try_from)]
39 #![feature(reverse_bits)]
40 #![cfg_attr(stage0, feature(underscore_imports))]
41
42 #![recursion_limit="256"]
43
44 extern crate arena;
45
46 #[macro_use]
47 extern crate bitflags;
48 #[macro_use] extern crate log;
49 extern crate either;
50 extern crate graphviz as dot;
51 extern crate polonius_engine;
52 #[macro_use]
53 extern crate rustc;
54 #[macro_use] extern crate rustc_data_structures;
55 extern crate serialize as rustc_serialize;
56 extern crate rustc_errors;
57 #[macro_use]
58 extern crate syntax;
59 extern crate syntax_pos;
60 extern crate rustc_target;
61 extern crate log_settings;
62 extern crate rustc_apfloat;
63 extern crate byteorder;
64 extern crate core;
65 extern crate smallvec;
66
67 // Once we can use edition 2018 in the compiler,
68 // replace this with real try blocks.
69 macro_rules! try_block {
70     ($($inside:tt)*) => (
71         (||{ ::std::ops::Try::from_ok({ $($inside)* }) })()
72     )
73 }
74
75 mod diagnostics;
76
77 mod borrow_check;
78 mod build;
79 mod dataflow;
80 mod hair;
81 mod lints;
82 mod shim;
83 pub mod transform;
84 pub mod util;
85 pub mod interpret;
86 pub mod monomorphize;
87 pub mod const_eval;
88
89 pub use hair::pattern::check_crate as matchck_crate;
90 use rustc::ty::query::Providers;
91
92 pub fn provide(providers: &mut Providers) {
93     borrow_check::provide(providers);
94     shim::provide(providers);
95     transform::provide(providers);
96     monomorphize::partitioning::provide(providers);
97     providers.const_eval = const_eval::const_eval_provider;
98     providers.const_eval_raw = const_eval::const_eval_raw_provider;
99     providers.check_match = hair::pattern::check_match;
100 }
101
102 __build_diagnostic_array! { librustc_mir, DIAGNOSTICS }