]> git.lizzy.rs Git - rust.git/blob - src/librustc/lib.rs
Rollup merge of #41135 - japaric:unstable-docs, r=steveklabnik
[rust.git] / src / librustc / lib.rs
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
17 #![crate_name = "rustc"]
18 #![unstable(feature = "rustc_private", issue = "27812")]
19 #![crate_type = "dylib"]
20 #![crate_type = "rlib"]
21 #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
22        html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
23        html_root_url = "https://doc.rust-lang.org/nightly/")]
24 #![deny(warnings)]
25
26 #![feature(associated_consts)]
27 #![feature(box_patterns)]
28 #![feature(box_syntax)]
29 #![feature(conservative_impl_trait)]
30 #![feature(const_fn)]
31 #![feature(core_intrinsics)]
32 #![feature(i128_type)]
33 #![feature(libc)]
34 #![feature(loop_break_value)]
35 #![feature(nonzero)]
36 #![cfg_attr(stage0, feature(pub_restricted))]
37 #![feature(quote)]
38 #![feature(rustc_diagnostic_macros)]
39 #![feature(rustc_private)]
40 #![feature(slice_patterns)]
41 #![feature(specialization)]
42 #![feature(staged_api)]
43 #![feature(unboxed_closures)]
44 #![feature(discriminant_value)]
45
46 extern crate arena;
47 extern crate core;
48 extern crate fmt_macros;
49 extern crate getopts;
50 extern crate graphviz;
51 extern crate libc;
52 extern crate rustc_llvm as llvm;
53 extern crate rustc_back;
54 extern crate rustc_data_structures;
55 extern crate serialize;
56 extern crate rustc_const_math;
57 extern crate rustc_errors as errors;
58 #[macro_use] extern crate log;
59 #[macro_use] extern crate syntax;
60 extern crate syntax_pos;
61 #[macro_use] #[no_link] extern crate rustc_bitflags;
62
63 extern crate serialize as rustc_serialize; // used by deriving
64
65 #[macro_use]
66 mod macros;
67
68 // NB: This module needs to be declared first so diagnostics are
69 // registered before they are used.
70 pub mod diagnostics;
71
72 pub mod cfg;
73 pub mod dep_graph;
74 pub mod hir;
75 pub mod ich;
76 pub mod infer;
77 pub mod lint;
78
79 pub mod middle {
80     pub mod expr_use_visitor;
81     pub mod const_val;
82     pub mod cstore;
83     pub mod dataflow;
84     pub mod dead;
85     pub mod dependency_format;
86     pub mod effect;
87     pub mod entry;
88     pub mod free_region;
89     pub mod intrinsicck;
90     pub mod lang_items;
91     pub mod liveness;
92     pub mod mem_categorization;
93     pub mod privacy;
94     pub mod reachable;
95     pub mod region;
96     pub mod recursion_limit;
97     pub mod resolve_lifetime;
98     pub mod stability;
99     pub mod weak_lang_items;
100 }
101
102 pub mod mir;
103 pub mod session;
104 pub mod traits;
105 pub mod ty;
106
107 pub mod util {
108     pub mod common;
109     pub mod ppaux;
110     pub mod nodemap;
111     pub mod fs;
112 }
113
114 // A private module so that macro-expanded idents like
115 // `::rustc::lint::Lint` will also work in `rustc` itself.
116 //
117 // `libstd` uses the same trick.
118 #[doc(hidden)]
119 mod rustc {
120     pub use lint;
121 }
122
123 // FIXME(#27438): right now the unit tests of librustc don't refer to any actual
124 //                functions generated in librustc_data_structures (all
125 //                references are through generic functions), but statics are
126 //                referenced from time to time. Due to this bug we won't
127 //                actually correctly link in the statics unless we also
128 //                reference a function, so be sure to reference a dummy
129 //                function.
130 #[test]
131 fn noop() {
132     rustc_data_structures::__noop_fix_for_27438();
133 }
134
135
136 // Build the diagnostics array at the end so that the metadata includes error use sites.
137 __build_diagnostic_array! { librustc, DIAGNOSTICS }