]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
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 | ||
c34b1796 AL |
17 | // Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364) |
18 | #![cfg_attr(stage0, feature(custom_attribute))] | |
1a4d82fc | 19 | #![crate_name = "rustc"] |
85aaf69f | 20 | #![unstable(feature = "rustc_private")] |
1a4d82fc JJ |
21 | #![staged_api] |
22 | #![crate_type = "dylib"] | |
23 | #![crate_type = "rlib"] | |
24 | #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", | |
62682a34 | 25 | html_favicon_url = "https://doc.rust-lang.org/favicon.ico", |
1a4d82fc JJ |
26 | html_root_url = "http://doc.rust-lang.org/nightly/")] |
27 | ||
62682a34 | 28 | #![feature(append)] |
d9579d0f | 29 | #![feature(associated_consts)] |
85aaf69f | 30 | #![feature(box_patterns)] |
1a4d82fc | 31 | #![feature(box_syntax)] |
62682a34 | 32 | #![feature(clone_from_slice)] |
85aaf69f | 33 | #![feature(collections)] |
62682a34 | 34 | #![feature(const_fn)] |
d9579d0f | 35 | #![feature(duration_span)] |
62682a34 SL |
36 | #![feature(dynamic_lib)] |
37 | #![feature(enumset)] | |
d9579d0f | 38 | #![feature(fs_canonicalize)] |
62682a34 | 39 | #![feature(hashmap_hasher)] |
d9579d0f | 40 | #![feature(into_cow)] |
62682a34 SL |
41 | #![feature(iter_cmp)] |
42 | #![feature(iter_arith)] | |
85aaf69f | 43 | #![feature(libc)] |
62682a34 | 44 | #![feature(num_bits_bytes)] |
d9579d0f | 45 | #![feature(path_ext)] |
85aaf69f | 46 | #![feature(quote)] |
62682a34 SL |
47 | #![feature(range_inclusive)] |
48 | #![feature(ref_slice)] | |
1a4d82fc | 49 | #![feature(rustc_diagnostic_macros)] |
85aaf69f | 50 | #![feature(rustc_private)] |
62682a34 SL |
51 | #![feature(scoped_tls)] |
52 | #![feature(slice_bytes)] | |
c1a9b12d | 53 | #![feature(slice_splits)] |
d9579d0f | 54 | #![feature(slice_patterns)] |
85aaf69f | 55 | #![feature(staged_api)] |
c34b1796 | 56 | #![feature(str_char)] |
62682a34 SL |
57 | #![feature(str_match_indices)] |
58 | #![feature(vec_push_all)] | |
59 | #![feature(wrapping)] | |
c1a9b12d SL |
60 | #![feature(cell_extras)] |
61 | #![feature(page_size)] | |
85aaf69f | 62 | #![cfg_attr(test, feature(test))] |
1a4d82fc | 63 | |
c34b1796 AL |
64 | #![allow(trivial_casts)] |
65 | ||
1a4d82fc JJ |
66 | extern crate arena; |
67 | extern crate flate; | |
85aaf69f | 68 | extern crate fmt_macros; |
1a4d82fc JJ |
69 | extern crate getopts; |
70 | extern crate graphviz; | |
71 | extern crate libc; | |
72 | extern crate rustc_llvm; | |
73 | extern crate rustc_back; | |
d9579d0f | 74 | extern crate rustc_data_structures; |
1a4d82fc JJ |
75 | extern crate serialize; |
76 | extern crate rbml; | |
77 | extern crate collections; | |
78 | #[macro_use] extern crate log; | |
79 | #[macro_use] extern crate syntax; | |
85aaf69f | 80 | #[macro_use] #[no_link] extern crate rustc_bitflags; |
1a4d82fc | 81 | |
c34b1796 | 82 | extern crate serialize as rustc_serialize; // used by deriving |
1a4d82fc JJ |
83 | |
84 | #[cfg(test)] | |
85 | extern crate test; | |
86 | ||
87 | pub use rustc_llvm as llvm; | |
88 | ||
9346a6ac AL |
89 | #[macro_use] |
90 | mod macros; | |
91 | ||
85aaf69f SL |
92 | // NB: This module needs to be declared first so diagnostics are |
93 | // registered before they are used. | |
94 | pub mod diagnostics; | |
1a4d82fc JJ |
95 | |
96 | pub mod back { | |
97 | pub use rustc_back::abi; | |
1a4d82fc JJ |
98 | pub use rustc_back::rpath; |
99 | pub use rustc_back::svh; | |
1a4d82fc JJ |
100 | } |
101 | ||
62682a34 SL |
102 | pub mod ast_map; |
103 | ||
1a4d82fc JJ |
104 | pub mod middle { |
105 | pub mod astconv_util; | |
106 | pub mod astencode; | |
62682a34 | 107 | pub mod cast; |
1a4d82fc JJ |
108 | pub mod cfg; |
109 | pub mod check_const; | |
110 | pub mod check_static_recursion; | |
111 | pub mod check_loop; | |
112 | pub mod check_match; | |
113 | pub mod check_rvalues; | |
1a4d82fc JJ |
114 | pub mod const_eval; |
115 | pub mod dataflow; | |
116 | pub mod dead; | |
117 | pub mod def; | |
118 | pub mod dependency_format; | |
119 | pub mod effect; | |
120 | pub mod entry; | |
121 | pub mod expr_use_visitor; | |
122 | pub mod fast_reject; | |
bd371182 | 123 | pub mod free_region; |
1a4d82fc JJ |
124 | pub mod intrinsicck; |
125 | pub mod infer; | |
bd371182 | 126 | pub mod implicator; |
1a4d82fc JJ |
127 | pub mod lang_items; |
128 | pub mod liveness; | |
129 | pub mod mem_categorization; | |
130 | pub mod pat_util; | |
131 | pub mod privacy; | |
132 | pub mod reachable; | |
133 | pub mod region; | |
134 | pub mod recursion_limit; | |
135 | pub mod resolve_lifetime; | |
136 | pub mod stability; | |
137 | pub mod subst; | |
138 | pub mod traits; | |
139 | pub mod ty; | |
140 | pub mod ty_fold; | |
c34b1796 AL |
141 | pub mod ty_match; |
142 | pub mod ty_relate; | |
1a4d82fc JJ |
143 | pub mod ty_walk; |
144 | pub mod weak_lang_items; | |
145 | } | |
146 | ||
147 | pub mod metadata; | |
148 | ||
149 | pub mod session; | |
150 | ||
151 | pub mod plugin; | |
152 | ||
153 | pub mod lint; | |
154 | ||
155 | pub mod util { | |
1a4d82fc JJ |
156 | pub use rustc_back::sha2; |
157 | ||
158 | pub mod common; | |
159 | pub mod ppaux; | |
160 | pub mod nodemap; | |
1a4d82fc | 161 | pub mod lev_distance; |
9346a6ac | 162 | pub mod num; |
d9579d0f | 163 | pub mod fs; |
1a4d82fc JJ |
164 | } |
165 | ||
166 | pub mod lib { | |
167 | pub use llvm; | |
168 | } | |
169 | ||
1a4d82fc JJ |
170 | // A private module so that macro-expanded idents like |
171 | // `::rustc::lint::Lint` will also work in `rustc` itself. | |
172 | // | |
173 | // `libstd` uses the same trick. | |
174 | #[doc(hidden)] | |
175 | mod rustc { | |
176 | pub use lint; | |
177 | } | |
d9579d0f AL |
178 | |
179 | // Build the diagnostics array at the end so that the metadata includes error use sites. | |
d9579d0f | 180 | __build_diagnostic_array! { librustc, DIAGNOSTICS } |