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 #![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)]
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)]
39 #![feature(reverse_bits)]
40 #![feature(underscore_imports)]
42 #![recursion_limit="256"]
47 extern crate bitflags;
48 #[macro_use] extern crate log;
50 extern crate graphviz as dot;
51 extern crate polonius_engine;
54 #[macro_use] extern crate rustc_data_structures;
55 extern crate serialize as rustc_serialize;
56 extern crate rustc_errors;
59 extern crate syntax_pos;
60 extern crate rustc_target;
61 extern crate log_settings;
62 extern crate rustc_apfloat;
63 extern crate byteorder;
65 extern crate smallvec;
67 // Once we can use edition 2018 in the compiler,
68 // replace this with real try blocks.
69 macro_rules! try_block {
71 (||{ ::std::ops::Try::from_ok({ $($inside)* }) })()
89 pub use hair::pattern::check_crate as matchck_crate;
90 use rustc::ty::query::Providers;
92 pub fn provide(providers: &mut Providers) {
93 borrow_check::provide(providers);
94 shim::provide(providers);
95 transform::provide(providers);
96 providers.const_eval = const_eval::const_eval_provider;
97 providers.const_eval_raw = const_eval::const_eval_raw_provider;
98 providers.check_match = hair::pattern::check_match;
101 __build_diagnostic_array! { librustc_mir, DIAGNOSTICS }