lib.rs 3.1 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_id = "rustc#0.11.0-pre"]
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/")]
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

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

46
pub mod middle {
47
    pub mod def;
48
    pub mod trans;
49
    pub mod ty;
50
    pub mod ty_fold;
51
    pub mod subst;
52
    pub mod resolve;
53
    pub mod resolve_lifetime;
B
Brian Anderson 已提交
54
    pub mod typeck;
55 56 57
    pub mod check_loop;
    pub mod check_match;
    pub mod check_const;
58
    pub mod check_static;
59
    pub mod borrowck;
N
Niko Matsakis 已提交
60
    pub mod dataflow;
61 62 63 64 65 66 67 68 69 70
    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;
71
    pub mod entry;
72
    pub mod effect;
73
    pub mod reachable;
74
    pub mod graph;
75
    pub mod cfg;
K
Kiet Tran 已提交
76
    pub mod dead;
77
    pub mod expr_use_visitor;
78
    pub mod dependency_format;
79
    pub mod weak_lang_items;
80
    pub mod save;
81
    pub mod intrinsicck;
A
Aaron Turon 已提交
82
    pub mod stability;
83 84
}

85 86 87
pub mod front {
    pub mod config;
    pub mod test;
88
    pub mod std_inject;
E
Eduard Burtescu 已提交
89
    pub mod assign_node_ids_and_map;
90
    pub mod feature_gate;
S
Seo Sanghyeon 已提交
91
    pub mod show_span;
G
Graydon Hoare 已提交
92 93
}

94 95
pub mod back {
    pub mod abi;
96
    pub mod archive;
97
    pub mod arm;
98 99
    pub mod link;
    pub mod lto;
J
Jyun-Yan You 已提交
100
    pub mod mips;
101
    pub mod mipsel;
102
    pub mod rpath;
103
    pub mod svh;
104
    pub mod target_strs;
105 106
    pub mod x86;
    pub mod x86_64;
107 108
}

109
pub mod metadata;
110

111
pub mod driver;
G
Graydon Hoare 已提交
112

K
Keegan McAllister 已提交
113
pub mod plugin;
114

K
Keegan McAllister 已提交
115 116
pub mod lint;

117 118 119
pub mod util {
    pub mod common;
    pub mod ppaux;
120
    pub mod sha2;
121
    pub mod nodemap;
122
    pub mod fs;
G
Graydon Hoare 已提交
123 124
}

125 126
pub mod lib {
    pub mod llvm;
127
    pub mod llvmdeps;
G
Graydon Hoare 已提交
128 129
}

130 131 132 133 134 135 136 137 138
// 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;
}

139
pub fn main() {
140
    let args = std::os::args().iter()
141
                              .map(|x| x.to_string())
142 143
                              .collect::<Vec<_>>();
    std::os::set_exit_status(driver::main_args(args.as_slice()));
144
}