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