lib.rs 3.4 KB
Newer Older
S
sevrak 已提交
1
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
2 3 4 5 6 7 8 9 10
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

11 12 13 14 15 16 17 18 19 20
/*!

The Rust compiler.

# Note

This API is completely unstable and subject to change.

*/

21
#![crate_name = "rustc"]
22
#![experimental]
23 24 25 26 27
#![comment = "The Rust compiler"]
#![license = "MIT/ASL2"]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
#![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/nightly/")]
B
Brian Anderson 已提交
30

31
#![allow(deprecated)]
32
#![allow(unknown_features)]
33
#![feature(macro_rules, globs, struct_variant, quote)]
34
#![feature(default_type_params, phase, unsafe_destructor, slicing_syntax)]
35

36
#![feature(rustc_diagnostic_macros)]
37
#![feature(import_shadowing)]
38

A
Alex Crichton 已提交
39
extern crate arena;
40 41 42
extern crate debug;
extern crate flate;
extern crate getopts;
43
extern crate graphviz;
44
extern crate libc;
45 46
extern crate rustc_llvm;
extern crate rustc_back;
A
Alex Crichton 已提交
47
extern crate serialize;
48
extern crate rbml;
A
Arcterus 已提交
49
extern crate time;
A
Alex Crichton 已提交
50
#[phase(plugin, link)] extern crate log;
51 52
#[phase(plugin, link)] extern crate syntax;

53 54 55
#[cfg(test)]
extern crate test;

56 57
pub use rustc_llvm as llvm;

58
mod diagnostics;
59

60 61
pub mod back {
    pub use rustc_back::abi;
62
    pub use rustc_back::archive;
63 64 65
    pub use rustc_back::arm;
    pub use rustc_back::mips;
    pub use rustc_back::mipsel;
66
    pub use rustc_back::rpath;
67 68 69 70 71 72 73
    pub use rustc_back::svh;
    pub use rustc_back::target_strs;
    pub use rustc_back::x86;
    pub use rustc_back::x86_64;

    pub mod link;
    pub mod lto;
74
    pub mod write;
75 76 77

}

78
pub mod middle {
79 80 81 82
    pub mod astencode;
    pub mod borrowck;
    pub mod cfg;
    pub mod check_const;
83
    pub mod check_static_recursion;
84 85
    pub mod check_loop;
    pub mod check_match;
N
Nick Cameron 已提交
86
    pub mod check_rvalues;
87
    pub mod check_static;
88
    pub mod const_eval;
N
Niko Matsakis 已提交
89
    pub mod dataflow;
90 91 92 93 94 95 96 97
    pub mod dead;
    pub mod def;
    pub mod dependency_format;
    pub mod effect;
    pub mod entry;
    pub mod expr_use_visitor;
    pub mod graph;
    pub mod intrinsicck;
98
    pub mod lang_items;
99
    pub mod liveness;
100
    pub mod macros;
101 102
    pub mod mem_categorization;
    pub mod pat_util;
103
    pub mod privacy;
104
    pub mod reachable;
105 106 107
    pub mod region;
    pub mod resolve;
    pub mod resolve_lifetime;
108
    pub mod save;
A
Aaron Turon 已提交
109
    pub mod stability;
110
    pub mod subst;
111
    pub mod traits;
112 113 114 115 116
    pub mod trans;
    pub mod ty;
    pub mod ty_fold;
    pub mod typeck;
    pub mod weak_lang_items;
117 118
}

119
pub mod metadata;
120

121
pub mod driver;
G
Graydon Hoare 已提交
122

K
Keegan McAllister 已提交
123
pub mod plugin;
124

K
Keegan McAllister 已提交
125 126
pub mod lint;

127
pub mod util {
128
    pub use rustc_back::fs;
129
    pub use rustc_back::sha2;
130

131 132
    pub mod common;
    pub mod ppaux;
133
    pub mod nodemap;
134
    pub mod snapshot_vec;
G
Graydon Hoare 已提交
135 136
}

137
pub mod lib {
138
    pub use llvm;
G
Graydon Hoare 已提交
139 140
}

141 142
__build_diagnostic_array!(DIAGNOSTICS)

143 144 145 146 147 148 149 150 151
// A private module so that macro-expanded idents like
// `::rustc::lint::Lint` will also work in `rustc` itself.
//
// `libstd` uses the same trick.
#[doc(hidden)]
mod rustc {
    pub use lint;
}

152
pub fn main() {
153
    let args = std::os::args();
154 155
    let result = driver::run(args);
    std::os::set_exit_status(result);
156
}