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/master/")]
B
Brian Anderson 已提交
30

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

35 36 37
#![allow(unknown_features)] // NOTE: Remove after next snapshot
#![feature(rustc_diagnostic_macros)]

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

mod diagnostics;
52

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

}
>>>>>>> Extract librustc_back from librustc

71
pub mod middle {
72
    pub mod def;
73
    pub mod trans;
74
    pub mod ty;
75
    pub mod ty_fold;
76
    pub mod subst;
77
    pub mod resolve;
78
    pub mod resolve_lifetime;
B
Brian Anderson 已提交
79
    pub mod typeck;
80 81 82
    pub mod check_loop;
    pub mod check_match;
    pub mod check_const;
83
    pub mod check_static;
84
    pub mod borrowck;
N
Niko Matsakis 已提交
85
    pub mod dataflow;
86 87 88 89 90 91 92 93 94 95
    pub mod mem_categorization;
    pub mod liveness;
    pub mod kind;
    pub mod freevars;
    pub mod pat_util;
    pub mod region;
    pub mod const_eval;
    pub mod astencode;
    pub mod lang_items;
    pub mod privacy;
96
    pub mod entry;
97
    pub mod effect;
98
    pub mod reachable;
99
    pub mod graph;
100
    pub mod cfg;
K
Kiet Tran 已提交
101
    pub mod dead;
102
    pub mod expr_use_visitor;
103
    pub mod dependency_format;
104
    pub mod weak_lang_items;
105
    pub mod save;
106
    pub mod intrinsicck;
A
Aaron Turon 已提交
107
    pub mod stability;
108 109
}

110 111 112
pub mod front {
    pub mod config;
    pub mod test;
113
    pub mod std_inject;
E
Eduard Burtescu 已提交
114
    pub mod assign_node_ids_and_map;
115
    pub mod feature_gate;
S
Seo Sanghyeon 已提交
116
    pub mod show_span;
G
Graydon Hoare 已提交
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 128 129
pub mod util {
    pub mod common;
    pub mod ppaux;
130
    pub mod sha2;
131
    pub mod nodemap;
132
    pub mod fs;
G
Graydon Hoare 已提交
133 134
}

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

139 140
__build_diagnostic_array!(DIAGNOSTICS)

141 142 143 144 145 146 147 148 149
// 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;
}

150
pub fn main() {
151
    let args = std::os::args();
152
    std::os::set_exit_status(driver::main_args(args.as_slice()));
153
}