lib.rs 3.7 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
       html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
       html_root_url = "https://doc.rust-lang.org/nightly/")]
24
#![deny(warnings)]
B
Brian Anderson 已提交
25

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

A
Alex Crichton 已提交
45
extern crate arena;
46
extern crate core;
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;
55
extern crate rustc_const_math;
56
extern crate rustc_errors as errors;
A
Alex Crichton 已提交
57 58
#[macro_use] extern crate log;
#[macro_use] extern crate syntax;
59
extern crate syntax_pos;
60
#[macro_use] #[no_link] extern crate rustc_bitflags;
61

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

64 65 66
#[macro_use]
mod macros;

67 68 69
// NB: This module needs to be declared first so diagnostics are
// registered before they are used.
pub mod diagnostics;
70

71
pub mod cfg;
72
pub mod dep_graph;
73
pub mod hir;
74 75 76
pub mod infer;
pub mod lint;

77
pub mod middle {
78
    pub mod astconv_util;
79
    pub mod expr_use_visitor;
80
    pub mod const_val;
81
    pub mod cstore;
N
Niko Matsakis 已提交
82
    pub mod dataflow;
83 84 85 86
    pub mod dead;
    pub mod dependency_format;
    pub mod effect;
    pub mod entry;
87
    pub mod free_region;
88
    pub mod intrinsicck;
89
    pub mod lang_items;
90 91
    pub mod liveness;
    pub mod mem_categorization;
92
    pub mod privacy;
93
    pub mod reachable;
94
    pub mod region;
95
    pub mod recursion_limit;
96
    pub mod resolve_lifetime;
A
Aaron Turon 已提交
97
    pub mod stability;
98
    pub mod weak_lang_items;
99 100
}

E
Eduard Burtescu 已提交
101
pub mod mir;
102
pub mod session;
103 104
pub mod traits;
pub mod ty;
K
Keegan McAllister 已提交
105

106 107 108
pub mod util {
    pub mod common;
    pub mod ppaux;
109
    pub mod nodemap;
110
    pub mod fs;
G
Graydon Hoare 已提交
111 112
}

113 114 115 116 117 118 119 120
// 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;
}
121

122 123 124 125 126 127 128 129 130 131 132 133 134
// 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();
}


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