]> git.lizzy.rs Git - rust.git/blob - src/librustc_mir/lib.rs
Use optimized SmallVec implementation
[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 #![cfg_attr(not(stage0), feature(nll))]
18 #![feature(infer_outlives_requirements)]
19 #![feature(in_band_lifetimes)]
20 #![feature(slice_patterns)]
21 #![feature(slice_sort_by_cached_key)]
22 #![feature(box_patterns)]
23 #![feature(box_syntax)]
24 #![feature(catch_expr)]
25 #![feature(crate_visibility_modifier)]
26 #![feature(const_fn)]
27 #![feature(core_intrinsics)]
28 #![feature(decl_macro)]
29 #![cfg_attr(stage0, feature(macro_vis_matcher))]
30 #![feature(exhaustive_patterns)]
31 #![feature(range_contains)]
32 #![feature(rustc_diagnostic_macros)]
33 #![feature(never_type)]
34 #![feature(specialization)]
35 #![feature(try_trait)]
36 #![feature(unicode_internals)]
37 #![feature(step_trait)]
38 #![feature(slice_concat_ext)]
39 #![feature(if_while_or_patterns)]
40 #![feature(try_from)]
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 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::query::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.const_to_allocation = interpret::const_to_allocation_provider;
88     providers.check_match = hair::pattern::check_match;
89 }
90
91 __build_diagnostic_array! { librustc_mir, DIAGNOSTICS }