lib.rs 3.3 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 32
#![feature(default_type_params, globs, if_let, import_shadowing, macro_rules, phase, quote)]
#![feature(slicing_syntax, struct_variant, unsafe_destructor)]
33 34
#![feature(rustc_diagnostic_macros)]

A
Alex Crichton 已提交
35
extern crate arena;
36 37
extern crate flate;
extern crate getopts;
38
extern crate graphviz;
39
extern crate libc;
40 41
extern crate rustc_llvm;
extern crate rustc_back;
A
Alex Crichton 已提交
42
extern crate serialize;
43
extern crate rbml;
A
Alex Crichton 已提交
44
#[phase(plugin, link)] extern crate log;
45 46
#[phase(plugin, link)] extern crate syntax;

47 48 49
#[cfg(test)]
extern crate test;

50 51
pub use rustc_llvm as llvm;

52
mod diagnostics;
53

54 55
pub mod back {
    pub use rustc_back::abi;
56
    pub use rustc_back::archive;
57 58 59
    pub use rustc_back::arm;
    pub use rustc_back::mips;
    pub use rustc_back::mipsel;
60
    pub use rustc_back::rpath;
61 62 63 64 65 66 67
    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;
68
    pub mod write;
69 70 71

}

72
pub mod middle {
73 74 75 76
    pub mod astencode;
    pub mod borrowck;
    pub mod cfg;
    pub mod check_const;
77
    pub mod check_static_recursion;
78 79
    pub mod check_loop;
    pub mod check_match;
N
Nick Cameron 已提交
80
    pub mod check_rvalues;
81
    pub mod check_static;
82
    pub mod const_eval;
N
Niko Matsakis 已提交
83
    pub mod dataflow;
84 85 86 87 88 89 90 91
    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;
92
    pub mod lang_items;
93 94 95
    pub mod liveness;
    pub mod mem_categorization;
    pub mod pat_util;
96
    pub mod privacy;
97
    pub mod reachable;
98 99 100
    pub mod region;
    pub mod resolve;
    pub mod resolve_lifetime;
101
    pub mod save;
A
Aaron Turon 已提交
102
    pub mod stability;
103
    pub mod subst;
104
    pub mod traits;
105 106 107 108 109
    pub mod trans;
    pub mod ty;
    pub mod ty_fold;
    pub mod typeck;
    pub mod weak_lang_items;
110 111
}

112
pub mod metadata;
113

114
pub mod driver;
G
Graydon Hoare 已提交
115

K
Keegan McAllister 已提交
116
pub mod plugin;
117

K
Keegan McAllister 已提交
118 119
pub mod lint;

120
pub mod util {
121
    pub use rustc_back::fs;
122
    pub use rustc_back::sha2;
123

124 125
    pub mod common;
    pub mod ppaux;
126
    pub mod nodemap;
127
    pub mod snapshot_vec;
G
Graydon Hoare 已提交
128 129
}

130
pub mod lib {
131
    pub use llvm;
G
Graydon Hoare 已提交
132 133
}

134 135
__build_diagnostic_array!(DIAGNOSTICS)

136 137 138 139 140 141 142 143 144
// 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;
}

145
pub fn main() {
146
    let args = std::os::args();
147 148
    let result = driver::run(args);
    std::os::set_exit_status(result);
149
}