lib.rs 4.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.

S
Steve Klabnik 已提交
11 12 13 14 15
//! The Rust compiler.
//!
//! # Note
//!
//! This API is completely unstable and subject to change.
16

17 18
// Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
#![cfg_attr(stage0, feature(custom_attribute))]
19
#![crate_name = "rustc"]
20
#![unstable(feature = "rustc_private")]
B
Brian Anderson 已提交
21
#![staged_api]
22 23 24
#![crate_type = "dylib"]
#![crate_type = "rlib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
A
Alex Crichton 已提交
25
      html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
26
      html_root_url = "http://doc.rust-lang.org/nightly/")]
B
Brian Anderson 已提交
27

28
#![feature(append)]
T
Fallout  
Tamir Duberstein 已提交
29
#![feature(associated_consts)]
30
#![feature(box_patterns)]
31
#![feature(box_syntax)]
32
#![feature(clone_from_slice)]
33
#![feature(collections)]
N
Niko Matsakis 已提交
34
#![feature(const_fn)]
35
#![feature(core)]
36 37
#![feature(duration)]
#![feature(duration_span)]
38
#![feature(dynamic_lib)]
39
#![feature(enumset)]
40
#![feature(fs_canonicalize)]
41
#![feature(hashmap_hasher)]
T
Fallout  
Tamir Duberstein 已提交
42
#![feature(into_cow)]
43 44
#![feature(iter_cmp)]
#![feature(iter_arith)]
45
#![feature(libc)]
46
#![feature(nonzero)]
47
#![feature(num_bits_bytes)]
T
Fallout  
Tamir Duberstein 已提交
48
#![feature(path_ext)]
A
Alex Crichton 已提交
49
#![feature(quote)]
50 51
#![feature(range_inclusive)]
#![feature(ref_slice)]
A
Alex Crichton 已提交
52
#![feature(rustc_diagnostic_macros)]
53
#![feature(rustc_private)]
54
#![feature(scoped_tls)]
55
#![feature(slice_bytes)]
S
Simonas Kazlauskas 已提交
56
#![feature(slice_splits)]
T
Fallout  
Tamir Duberstein 已提交
57
#![feature(slice_patterns)]
A
Alex Crichton 已提交
58
#![feature(staged_api)]
59
#![feature(str_char)]
60
#![feature(str_match_indices)]
61
#![feature(vec_push_all)]
62
#![feature(wrapping)]
63
#![feature(cell_extras)]
N
Nick Cameron 已提交
64
#![feature(page_size)]
65
#![cfg_attr(test, feature(test))]
66

N
Nick Cameron 已提交
67
#![allow(trivial_casts)]
N
Nick Cameron 已提交
68

A
Alex Crichton 已提交
69
extern crate arena;
70
extern crate core;
71
extern crate flate;
72
extern crate fmt_macros;
73
extern crate getopts;
74
extern crate graphviz;
75
extern crate libc;
76 77
extern crate rustc_llvm;
extern crate rustc_back;
78
extern crate rustc_data_structures;
A
Alex Crichton 已提交
79
extern crate serialize;
80
extern crate rbml;
A
Alexis Beingessner 已提交
81
extern crate collections;
A
Alex Crichton 已提交
82 83
#[macro_use] extern crate log;
#[macro_use] extern crate syntax;
84
#[macro_use] #[no_link] extern crate rustc_bitflags;
85

A
Alex Crichton 已提交
86
extern crate serialize as rustc_serialize; // used by deriving
87

88 89 90
#[cfg(test)]
extern crate test;

91 92
pub use rustc_llvm as llvm;

93 94 95
#[macro_use]
mod macros;

96 97 98
// NB: This module needs to be declared first so diagnostics are
// registered before they are used.
pub mod diagnostics;
99

100 101
pub mod back {
    pub use rustc_back::abi;
102
    pub use rustc_back::rpath;
103 104 105
    pub use rustc_back::svh;
}

106 107
pub mod ast_map;

108
pub mod middle {
109
    pub mod astconv_util;
110
    pub mod astencode;
111
    pub mod cast;
112 113
    pub mod cfg;
    pub mod check_const;
114
    pub mod check_static_recursion;
115 116
    pub mod check_loop;
    pub mod check_match;
N
Nick Cameron 已提交
117
    pub mod check_rvalues;
118
    pub mod const_eval;
N
Niko Matsakis 已提交
119
    pub mod dataflow;
120 121 122 123 124 125
    pub mod dead;
    pub mod def;
    pub mod dependency_format;
    pub mod effect;
    pub mod entry;
    pub mod expr_use_visitor;
126
    pub mod fast_reject;
127
    pub mod free_region;
128
    pub mod intrinsicck;
129
    pub mod infer;
130
    pub mod implicator;
131
    pub mod lang_items;
132 133 134
    pub mod liveness;
    pub mod mem_categorization;
    pub mod pat_util;
135
    pub mod privacy;
136
    pub mod reachable;
137
    pub mod region;
138
    pub mod recursion_limit;
139
    pub mod resolve_lifetime;
A
Aaron Turon 已提交
140
    pub mod stability;
141
    pub mod subst;
142
    pub mod traits;
143 144
    pub mod ty;
    pub mod ty_fold;
145
    pub mod ty_match;
146
    pub mod ty_relate;
147
    pub mod ty_walk;
148
    pub mod weak_lang_items;
149 150
}

151
pub mod metadata;
152

153
pub mod session;
G
Graydon Hoare 已提交
154

K
Keegan McAllister 已提交
155
pub mod plugin;
156

K
Keegan McAllister 已提交
157 158
pub mod lint;

159
pub mod util {
160
    pub use rustc_back::sha2;
161

162 163
    pub mod common;
    pub mod ppaux;
164
    pub mod nodemap;
A
Alex Crichton 已提交
165
    pub mod lev_distance;
166
    pub mod num;
167
    pub mod fs;
G
Graydon Hoare 已提交
168 169
}

170
pub mod lib {
171
    pub use llvm;
G
Graydon Hoare 已提交
172 173
}

174 175 176 177 178 179 180 181
// 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;
}
182 183 184

// Build the diagnostics array at the end so that the metadata includes error use sites.
__build_diagnostic_array! { librustc, DIAGNOSTICS }