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