]> git.lizzy.rs Git - rust.git/blob - src/librustc/lib.rs
Auto merge of #30639 - rkruppe:dec2flt-fastpath-tables, r=alexcrichton
[rust.git] / src / librustc / lib.rs
1 // Copyright 2012-2013 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 //! The Rust compiler.
12 //!
13 //! # Note
14 //!
15 //! This API is completely unstable and subject to change.
16
17 #![crate_name = "rustc"]
18 #![unstable(feature = "rustc_private", issue = "27812")]
19 #![crate_type = "dylib"]
20 #![crate_type = "rlib"]
21 #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
22       html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
23       html_root_url = "https://doc.rust-lang.org/nightly/")]
24
25 #![feature(associated_consts)]
26 #![feature(box_patterns)]
27 #![feature(box_syntax)]
28 #![feature(cell_extras)]
29 #![feature(clone_from_slice)]
30 #![feature(collections)]
31 #![feature(const_fn)]
32 #![feature(enumset)]
33 #![feature(hashmap_hasher)]
34 #![feature(into_cow)]
35 #![feature(iter_arith)]
36 #![feature(libc)]
37 #![feature(nonzero)]
38 #![feature(num_bits_bytes)]
39 #![feature(quote)]
40 #![feature(rustc_diagnostic_macros)]
41 #![feature(rustc_private)]
42 #![feature(scoped_tls)]
43 #![feature(slice_patterns)]
44 #![feature(staged_api)]
45 #![feature(str_char)]
46 #![feature(time2)]
47 #![feature(wrapping)]
48 #![cfg_attr(test, feature(test))]
49
50 #![allow(trivial_casts)]
51
52 extern crate arena;
53 extern crate core;
54 extern crate flate;
55 extern crate fmt_macros;
56 extern crate getopts;
57 extern crate graphviz;
58 extern crate libc;
59 extern crate rbml;
60 extern crate rustc_llvm;
61 extern crate rustc_back;
62 extern crate rustc_front;
63 extern crate rustc_data_structures;
64 extern crate serialize;
65 extern crate collections;
66 #[macro_use] extern crate log;
67 #[macro_use] extern crate syntax;
68 #[macro_use] #[no_link] extern crate rustc_bitflags;
69
70 extern crate serialize as rustc_serialize; // used by deriving
71
72 #[cfg(test)]
73 extern crate test;
74
75 pub use rustc_llvm as llvm;
76
77 #[macro_use]
78 mod macros;
79
80 // NB: This module needs to be declared first so diagnostics are
81 // registered before they are used.
82 pub mod diagnostics;
83
84 pub mod back {
85     pub use rustc_back::abi;
86     pub use rustc_back::rpath;
87     pub use rustc_back::svh;
88 }
89
90 pub mod dep_graph;
91
92 pub mod front {
93     pub mod check_attr;
94     pub mod map;
95 }
96
97 pub mod middle {
98     pub mod astconv_util;
99     pub mod expr_use_visitor; // STAGE0: increase glitch immunity
100     pub mod cfg;
101     pub mod check_const;
102     pub mod check_static_recursion;
103     pub mod check_loop;
104     pub mod check_match;
105     pub mod check_no_asm;
106     pub mod check_rvalues;
107     pub mod const_eval;
108     pub mod cstore;
109     pub mod dataflow;
110     pub mod dead;
111     pub mod def;
112     pub mod def_id;
113     pub mod dependency_format;
114     pub mod effect;
115     pub mod entry;
116     pub mod free_region;
117     pub mod intrinsicck;
118     pub mod infer;
119     pub mod implicator;
120     pub mod lang_items;
121     pub mod liveness;
122     pub mod mem_categorization;
123     pub mod pat_util;
124     pub mod privacy;
125     pub mod reachable;
126     pub mod region;
127     pub mod recursion_limit;
128     pub mod resolve_lifetime;
129     pub mod stability;
130     pub mod subst;
131     pub mod traits;
132     pub mod ty;
133     pub mod weak_lang_items;
134 }
135
136 pub mod mir {
137     pub mod repr;
138     pub mod tcx;
139     pub mod visit;
140 }
141
142 pub mod session;
143
144 pub mod lint;
145
146 pub mod util {
147     pub use rustc_back::sha2;
148
149     pub mod common;
150     pub mod ppaux;
151     pub mod nodemap;
152     pub mod num;
153     pub mod fs;
154 }
155
156 pub mod lib {
157     pub use llvm;
158 }
159
160 // A private module so that macro-expanded idents like
161 // `::rustc::lint::Lint` will also work in `rustc` itself.
162 //
163 // `libstd` uses the same trick.
164 #[doc(hidden)]
165 mod rustc {
166     pub use lint;
167 }
168
169 // FIXME(#27438): right now the unit tests of librustc don't refer to any actual
170 //                functions generated in librustc_data_structures (all
171 //                references are through generic functions), but statics are
172 //                referenced from time to time. Due to this bug we won't
173 //                actually correctly link in the statics unless we also
174 //                reference a function, so be sure to reference a dummy
175 //                function.
176 #[test]
177 fn noop() {
178     rustc_data_structures::__noop_fix_for_27438();
179 }
180
181
182 // Build the diagnostics array at the end so that the metadata includes error use sites.
183 __build_diagnostic_array! { librustc, DIAGNOSTICS }