]> git.lizzy.rs Git - rust.git/blob - src/librustc/lib.rs
auto merge of #17246 : bkoropoff/rust/issue-17216, r=pnkfelix
[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_loop;
84     pub mod check_match;
85     pub mod check_rvalues;
86     pub mod check_static;
87     pub mod const_eval;
88     pub mod dataflow;
89     pub mod dead;
90     pub mod def;
91     pub mod dependency_format;
92     pub mod effect;
93     pub mod entry;
94     pub mod expr_use_visitor;
95     pub mod freevars;
96     pub mod graph;
97     pub mod intrinsicck;
98     pub mod kind;
99     pub mod lang_items;
100     pub mod liveness;
101     pub mod mem_categorization;
102     pub mod pat_util;
103     pub mod privacy;
104     pub mod reachable;
105     pub mod region;
106     pub mod resolve;
107     pub mod resolve_lifetime;
108     pub mod save;
109     pub mod stability;
110     pub mod subst;
111     pub mod traits;
112     pub mod trans;
113     pub mod ty;
114     pub mod ty_fold;
115     pub mod typeck;
116     pub mod weak_lang_items;
117 }
118
119 pub mod metadata;
120
121 pub mod driver;
122
123 pub mod plugin;
124
125 pub mod lint;
126
127 pub mod util {
128     pub use rustc_back::fs;
129     pub use rustc_back::sha2;
130
131     pub mod common;
132     pub mod ppaux;
133     pub mod nodemap;
134     pub mod snapshot_vec;
135 }
136
137 pub mod lib {
138     pub use llvm;
139 }
140
141 __build_diagnostic_array!(DIAGNOSTICS)
142
143 // A private module so that macro-expanded idents like
144 // `::rustc::lint::Lint` will also work in `rustc` itself.
145 //
146 // `libstd` uses the same trick.
147 #[doc(hidden)]
148 mod rustc {
149     pub use lint;
150 }
151
152 pub fn main() {
153     let args = std::os::args();
154     std::os::set_exit_status(driver::main_args(args.as_slice()));
155 }