]> git.proxmox.com Git - rustc.git/blame - src/librustc/lib.rs
Imported Upstream version 1.1.0+dfsg1
[rustc.git] / src / librustc / lib.rs
CommitLineData
1a4d82fc
JJ
1// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
11//! The Rust compiler.
12//!
13//! # Note
14//!
15//! This API is completely unstable and subject to change.
16
c34b1796
AL
17// Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
18#![cfg_attr(stage0, feature(custom_attribute))]
1a4d82fc 19#![crate_name = "rustc"]
85aaf69f 20#![unstable(feature = "rustc_private")]
1a4d82fc
JJ
21#![staged_api]
22#![crate_type = "dylib"]
23#![crate_type = "rlib"]
24#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
25 html_favicon_url = "http://www.rust-lang.org/favicon.ico",
26 html_root_url = "http://doc.rust-lang.org/nightly/")]
27
d9579d0f 28#![feature(associated_consts)]
85aaf69f 29#![feature(box_patterns)]
1a4d82fc 30#![feature(box_syntax)]
85aaf69f
SL
31#![feature(collections)]
32#![feature(core)]
d9579d0f
AL
33#![feature(duration)]
34#![feature(duration_span)]
35#![feature(fs_canonicalize)]
85aaf69f 36#![feature(hash)]
d9579d0f 37#![feature(into_cow)]
85aaf69f 38#![feature(libc)]
d9579d0f 39#![feature(path_ext)]
85aaf69f 40#![feature(quote)]
1a4d82fc 41#![feature(rustc_diagnostic_macros)]
85aaf69f 42#![feature(rustc_private)]
d9579d0f 43#![feature(slice_patterns)]
85aaf69f
SL
44#![feature(staged_api)]
45#![feature(std_misc)]
c34b1796 46#![feature(str_char)]
85aaf69f 47#![cfg_attr(test, feature(test))]
1a4d82fc 48
c34b1796
AL
49#![allow(trivial_casts)]
50
1a4d82fc
JJ
51extern crate arena;
52extern crate flate;
85aaf69f 53extern crate fmt_macros;
1a4d82fc
JJ
54extern crate getopts;
55extern crate graphviz;
56extern crate libc;
57extern crate rustc_llvm;
58extern crate rustc_back;
d9579d0f 59extern crate rustc_data_structures;
1a4d82fc
JJ
60extern crate serialize;
61extern crate rbml;
62extern crate collections;
63#[macro_use] extern crate log;
64#[macro_use] extern crate syntax;
85aaf69f 65#[macro_use] #[no_link] extern crate rustc_bitflags;
1a4d82fc 66
c34b1796 67extern crate serialize as rustc_serialize; // used by deriving
1a4d82fc
JJ
68
69#[cfg(test)]
70extern crate test;
71
72pub use rustc_llvm as llvm;
73
9346a6ac
AL
74#[macro_use]
75mod macros;
76
85aaf69f
SL
77// NB: This module needs to be declared first so diagnostics are
78// registered before they are used.
79pub mod diagnostics;
1a4d82fc
JJ
80
81pub mod back {
82 pub use rustc_back::abi;
83 pub use rustc_back::archive;
84 pub use rustc_back::arm;
85 pub use rustc_back::mips;
86 pub use rustc_back::mipsel;
87 pub use rustc_back::rpath;
88 pub use rustc_back::svh;
89 pub use rustc_back::target_strs;
90 pub use rustc_back::x86;
91 pub use rustc_back::x86_64;
92}
93
94pub mod middle {
95 pub mod astconv_util;
96 pub mod astencode;
97 pub mod cfg;
98 pub mod check_const;
99 pub mod check_static_recursion;
100 pub mod check_loop;
101 pub mod check_match;
102 pub mod check_rvalues;
1a4d82fc
JJ
103 pub mod const_eval;
104 pub mod dataflow;
105 pub mod dead;
106 pub mod def;
107 pub mod dependency_format;
108 pub mod effect;
109 pub mod entry;
110 pub mod expr_use_visitor;
111 pub mod fast_reject;
bd371182 112 pub mod free_region;
1a4d82fc
JJ
113 pub mod intrinsicck;
114 pub mod infer;
bd371182 115 pub mod implicator;
1a4d82fc
JJ
116 pub mod lang_items;
117 pub mod liveness;
118 pub mod mem_categorization;
119 pub mod pat_util;
120 pub mod privacy;
121 pub mod reachable;
122 pub mod region;
123 pub mod recursion_limit;
124 pub mod resolve_lifetime;
125 pub mod stability;
126 pub mod subst;
127 pub mod traits;
128 pub mod ty;
129 pub mod ty_fold;
c34b1796
AL
130 pub mod ty_match;
131 pub mod ty_relate;
1a4d82fc
JJ
132 pub mod ty_walk;
133 pub mod weak_lang_items;
134}
135
136pub mod metadata;
137
138pub mod session;
139
140pub mod plugin;
141
142pub mod lint;
143
144pub mod util {
1a4d82fc
JJ
145 pub use rustc_back::sha2;
146
147 pub mod common;
148 pub mod ppaux;
149 pub mod nodemap;
1a4d82fc 150 pub mod lev_distance;
9346a6ac 151 pub mod num;
d9579d0f 152 pub mod fs;
1a4d82fc
JJ
153}
154
155pub mod lib {
156 pub use llvm;
157}
158
1a4d82fc
JJ
159// A private module so that macro-expanded idents like
160// `::rustc::lint::Lint` will also work in `rustc` itself.
161//
162// `libstd` uses the same trick.
163#[doc(hidden)]
164mod rustc {
165 pub use lint;
166}
d9579d0f
AL
167
168// Build the diagnostics array at the end so that the metadata includes error use sites.
169#[cfg(stage0)]
170__build_diagnostic_array! { DIAGNOSTICS }
171#[cfg(not(stage0))]
172__build_diagnostic_array! { librustc, DIAGNOSTICS }