lib.rs 3.8 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
#![crate_name = "rustc"]
18
#![unstable(feature = "rustc_private", issue = "27812")]
19 20
#![crate_type = "dylib"]
#![crate_type = "rlib"]
21
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
22 23 24
       html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
       html_root_url = "https://doc.rust-lang.org/nightly/")]
#![cfg_attr(not(stage0), deny(warnings))]
B
Brian Anderson 已提交
25

T
Fallout  
Tamir Duberstein 已提交
26
#![feature(associated_consts)]
27
#![feature(box_patterns)]
28
#![feature(box_syntax)]
29
#![feature(collections)]
30
#![feature(conservative_impl_trait)]
N
Niko Matsakis 已提交
31
#![feature(const_fn)]
32
#![feature(core_intrinsics)]
J
Jeffrey Seyfried 已提交
33
#![cfg_attr(stage0, feature(item_like_imports))]
34
#![feature(libc)]
35
#![feature(nonzero)]
A
Alex Crichton 已提交
36 37
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
38
#![feature(rustc_private)]
T
Fallout  
Tamir Duberstein 已提交
39
#![feature(slice_patterns)]
A
Alex Crichton 已提交
40
#![feature(staged_api)]
41
#![feature(unboxed_closures)]
42
#![cfg_attr(test, feature(test))]
43

A
Alex Crichton 已提交
44
extern crate arena;
45
extern crate core;
46
extern crate flate;
47
extern crate fmt_macros;
48
extern crate getopts;
49
extern crate graphviz;
50
extern crate libc;
51
extern crate rustc_llvm as llvm;
52
extern crate rustc_back;
53
extern crate rustc_data_structures;
A
Alex Crichton 已提交
54
extern crate serialize;
A
Alexis Beingessner 已提交
55
extern crate collections;
56
extern crate rustc_const_math;
57
extern crate rustc_errors as errors;
A
Alex Crichton 已提交
58 59
#[macro_use] extern crate log;
#[macro_use] extern crate syntax;
60
#[macro_use] extern crate syntax_pos;
61
#[macro_use] #[no_link] extern crate rustc_bitflags;
62

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

65 66 67
#[cfg(test)]
extern crate test;

68 69 70
#[macro_use]
mod macros;

71 72 73
// NB: This module needs to be declared first so diagnostics are
// registered before they are used.
pub mod diagnostics;
74

75
pub mod cfg;
76
pub mod dep_graph;
77
pub mod hir;
78 79 80
pub mod infer;
pub mod lint;

81
pub mod middle {
82
    pub mod astconv_util;
83
    pub mod expr_use_visitor; // STAGE0: increase glitch immunity
84
    pub mod const_val;
85
    pub mod const_qualif;
86
    pub mod cstore;
N
Niko Matsakis 已提交
87
    pub mod dataflow;
88 89 90 91
    pub mod dead;
    pub mod dependency_format;
    pub mod effect;
    pub mod entry;
92
    pub mod free_region;
93
    pub mod intrinsicck;
94
    pub mod lang_items;
95 96
    pub mod liveness;
    pub mod mem_categorization;
97
    pub mod privacy;
98
    pub mod reachable;
99
    pub mod region;
100
    pub mod recursion_limit;
101
    pub mod resolve_lifetime;
A
Aaron Turon 已提交
102
    pub mod stability;
103
    pub mod weak_lang_items;
104 105
}

E
Eduard Burtescu 已提交
106
pub mod mir;
107
pub mod session;
108 109
pub mod traits;
pub mod ty;
K
Keegan McAllister 已提交
110

111 112 113
pub mod util {
    pub mod common;
    pub mod ppaux;
114
    pub mod nodemap;
115
    pub mod num;
116
    pub mod fs;
G
Graydon Hoare 已提交
117 118
}

119 120 121 122 123 124 125 126
// 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;
}
127

128 129 130 131 132 133 134 135 136 137 138 139 140
// FIXME(#27438): right now the unit tests of librustc don't refer to any actual
//                functions generated in librustc_data_structures (all
//                references are through generic functions), but statics are
//                referenced from time to time. Due to this bug we won't
//                actually correctly link in the statics unless we also
//                reference a function, so be sure to reference a dummy
//                function.
#[test]
fn noop() {
    rustc_data_structures::__noop_fix_for_27438();
}


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