]> git.lizzy.rs Git - rust.git/blob - src/librustc/lib.rs
auto merge of #16836 : P1start/rust/closure_ret_bang, 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 /*!
12
13 The Rust compiler.
14
15 # Note
16
17 This API is completely unstable and subject to change.
18
19 */
20
21 #![crate_name = "rustc"]
22 #![experimental]
23 #![comment = "The Rust compiler"]
24 #![license = "MIT/ASL2"]
25 #![crate_type = "dylib"]
26 #![crate_type = "rlib"]
27 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
28       html_favicon_url = "http://www.rust-lang.org/favicon.ico",
29       html_root_url = "http://doc.rust-lang.org/master/")]
30
31 #![allow(deprecated)]
32 #![feature(macro_rules, globs, struct_variant, managed_boxes, quote)]
33 #![feature(default_type_params, phase, unsafe_destructor)]
34
35 #![allow(unknown_features)] // NOTE: Remove after next snapshot
36 #![feature(rustc_diagnostic_macros)]
37 #![feature(import_shadowing)]
38
39 extern crate arena;
40 extern crate debug;
41 extern crate flate;
42 extern crate getopts;
43 extern crate graphviz;
44 extern crate libc;
45 extern crate rustc_llvm;
46 extern crate rustc_back;
47 extern crate serialize;
48 extern crate rbml;
49 extern crate time;
50 #[phase(plugin, link)] extern crate log;
51 #[phase(plugin, link)] extern crate syntax;
52
53 #[cfg(test)]
54 extern crate test;
55
56 pub use rustc_llvm as llvm;
57
58 mod diagnostics;
59
60 pub mod back {
61     pub use rustc_back::abi;
62     pub use rustc_back::archive;
63     pub use rustc_back::arm;
64     pub use rustc_back::mips;
65     pub use rustc_back::mipsel;
66     pub use rustc_back::rpath;
67     pub use rustc_back::svh;
68     pub use rustc_back::target_strs;
69     pub use rustc_back::x86;
70     pub use rustc_back::x86_64;
71
72     pub mod link;
73     pub mod lto;
74     pub mod write;
75
76 }
77
78 pub mod middle {
79     pub mod astencode;
80     pub mod borrowck;
81     pub mod cfg;
82     pub mod check_const;
83     pub mod check_static_recursion;
84     pub mod check_loop;
85     pub mod check_match;
86     pub mod check_rvalues;
87     pub mod check_static;
88     pub mod const_eval;
89     pub mod dataflow;
90     pub mod dead;
91     pub mod def;
92     pub mod dependency_format;
93     pub mod effect;
94     pub mod entry;
95     pub mod expr_use_visitor;
96     pub mod freevars;
97     pub mod graph;
98     pub mod intrinsicck;
99     pub mod kind;
100     pub mod lang_items;
101     pub mod liveness;
102     pub mod mem_categorization;
103     pub mod pat_util;
104     pub mod privacy;
105     pub mod reachable;
106     pub mod region;
107     pub mod resolve;
108     pub mod resolve_lifetime;
109     pub mod save;
110     pub mod stability;
111     pub mod subst;
112     pub mod traits;
113     pub mod trans;
114     pub mod ty;
115     pub mod ty_fold;
116     pub mod typeck;
117     pub mod weak_lang_items;
118 }
119
120 pub mod metadata;
121
122 pub mod driver;
123
124 pub mod plugin;
125
126 pub mod lint;
127
128 pub mod util {
129     pub use rustc_back::fs;
130     pub use rustc_back::sha2;
131
132     pub mod common;
133     pub mod ppaux;
134     pub mod nodemap;
135     pub mod snapshot_vec;
136 }
137
138 pub mod lib {
139     pub use llvm;
140 }
141
142 __build_diagnostic_array!(DIAGNOSTICS)
143
144 // A private module so that macro-expanded idents like
145 // `::rustc::lint::Lint` will also work in `rustc` itself.
146 //
147 // `libstd` uses the same trick.
148 #[doc(hidden)]
149 mod rustc {
150     pub use lint;
151 }
152
153 pub fn main() {
154     let args = std::os::args();
155     std::os::set_exit_status(driver::main_args(args.as_slice()));
156 }