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!
18 #![feature(in_band_lifetimes)]
19 #![cfg_attr(stage0, feature(impl_header_lifetime_elision))]
20 #![feature(slice_patterns)]
21 #![feature(slice_sort_by_cached_key)]
22 #![feature(box_patterns)]
23 #![feature(box_syntax)]
24 #![feature(crate_visibility_modifier)]
25 #![feature(core_intrinsics)]
27 #![feature(decl_macro)]
28 #![feature(exhaustive_patterns)]
29 #![feature(range_contains)]
30 #![feature(rustc_diagnostic_macros)]
31 #![feature(rustc_attrs)]
32 #![feature(never_type)]
33 #![feature(specialization)]
34 #![feature(try_trait)]
35 #![feature(unicode_internals)]
36 #![feature(step_trait)]
37 #![feature(slice_concat_ext)]
38 #![feature(if_while_or_patterns)]
40 #![feature(reverse_bits)]
41 #![feature(underscore_imports)]
43 #![recursion_limit="256"]
48 extern crate bitflags;
49 #[macro_use] extern crate log;
51 extern crate graphviz as dot;
52 extern crate polonius_engine;
55 #[macro_use] extern crate rustc_data_structures;
56 extern crate serialize as rustc_serialize;
57 extern crate rustc_errors;
60 extern crate syntax_pos;
61 extern crate rustc_target;
62 extern crate log_settings;
63 extern crate rustc_apfloat;
64 extern crate byteorder;
66 extern crate smallvec;
68 // Once we can use edition 2018 in the compiler,
69 // replace this with real try blocks.
70 macro_rules! try_block {
72 (||{ ::std::ops::Try::from_ok({ $($inside)* }) })()
90 pub use hair::pattern::check_crate as matchck_crate;
91 use rustc::ty::query::Providers;
93 pub fn provide(providers: &mut Providers) {
94 borrow_check::provide(providers);
95 shim::provide(providers);
96 transform::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;
102 __build_diagnostic_array! { librustc_mir, DIAGNOSTICS }