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