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!
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(crate_visibility_modifier)]
26 #![feature(core_intrinsics)]
27 #![feature(decl_macro)]
28 #![cfg_attr(stage0, feature(macro_vis_matcher))]
29 #![feature(exhaustive_patterns)]
30 #![feature(range_contains)]
31 #![feature(rustc_diagnostic_macros)]
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)]
41 #![recursion_limit="256"]
46 extern crate bitflags;
47 #[macro_use] extern crate log;
49 extern crate graphviz as dot;
50 extern crate polonius_engine;
53 #[macro_use] extern crate rustc_data_structures;
54 extern crate serialize as rustc_serialize;
55 extern crate rustc_errors;
58 extern crate syntax_pos;
59 extern crate rustc_target;
60 extern crate log_settings;
61 extern crate rustc_apfloat;
62 extern crate byteorder;
64 extern crate smallvec;
66 // Once we can use edition 2018 in the compiler,
67 // replace this with real try blocks.
68 macro_rules! try_block {
70 (||{ ::std::ops::Try::from_ok({ $($inside)* }) })()
86 pub use hair::pattern::check_crate as matchck_crate;
87 use rustc::ty::query::Providers;
89 pub fn provide(providers: &mut Providers) {
90 borrow_check::provide(providers);
91 shim::provide(providers);
92 transform::provide(providers);
93 providers.const_eval = interpret::const_eval_provider;
94 providers.const_to_allocation = interpret::const_to_allocation_provider;
95 providers.check_match = hair::pattern::check_match;
98 __build_diagnostic_array! { librustc_mir, DIAGNOSTICS }