2013-02-28 07:15:32 -06:00
|
|
|
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
|
2012-12-03 18:48:01 -06:00
|
|
|
// 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.
|
|
|
|
|
2014-11-25 20:17:11 -06:00
|
|
|
//! The Rust compiler.
|
|
|
|
//!
|
|
|
|
//! # Note
|
|
|
|
//!
|
|
|
|
//! This API is completely unstable and subject to change.
|
2014-01-07 23:17:52 -06:00
|
|
|
|
2014-07-01 09:12:04 -05:00
|
|
|
#![crate_name = "rustc"]
|
2014-06-18 00:13:36 -05:00
|
|
|
#![experimental]
|
2014-03-21 20:05:05 -05:00
|
|
|
#![comment = "The Rust compiler"]
|
|
|
|
#![license = "MIT/ASL2"]
|
|
|
|
#![crate_type = "dylib"]
|
|
|
|
#![crate_type = "rlib"]
|
|
|
|
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
|
2014-01-07 23:17:52 -06:00
|
|
|
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
|
2014-10-09 12:47:22 -05:00
|
|
|
html_root_url = "http://doc.rust-lang.org/nightly/")]
|
2011-05-05 21:44:00 -05:00
|
|
|
|
2014-10-14 13:41:50 -05:00
|
|
|
#![feature(default_type_params, globs, if_let, import_shadowing, macro_rules, phase, quote)]
|
2014-11-19 17:21:32 -06:00
|
|
|
#![feature(slicing_syntax, tuple_indexing, unsafe_destructor)]
|
2014-07-01 11:39:41 -05:00
|
|
|
#![feature(rustc_diagnostic_macros)]
|
|
|
|
|
2014-02-14 12:10:06 -06:00
|
|
|
extern crate arena;
|
2014-05-22 13:28:01 -05:00
|
|
|
extern crate flate;
|
|
|
|
extern crate getopts;
|
2014-04-17 14:00:08 -05:00
|
|
|
extern crate graphviz;
|
2014-05-22 13:28:01 -05:00
|
|
|
extern crate libc;
|
2014-09-06 13:54:11 -05:00
|
|
|
extern crate rustc_llvm;
|
|
|
|
extern crate rustc_back;
|
2014-02-14 12:10:06 -06:00
|
|
|
extern crate serialize;
|
2014-07-29 19:06:37 -05:00
|
|
|
extern crate rbml;
|
2014-06-11 20:47:09 -05:00
|
|
|
#[phase(plugin, link)] extern crate log;
|
2014-07-01 11:39:41 -05:00
|
|
|
#[phase(plugin, link)] extern crate syntax;
|
|
|
|
|
2014-07-29 18:31:39 -05:00
|
|
|
#[cfg(test)]
|
|
|
|
extern crate test;
|
|
|
|
|
2014-09-06 13:54:11 -05:00
|
|
|
pub use rustc_llvm as llvm;
|
|
|
|
|
2014-07-01 11:39:41 -05:00
|
|
|
mod diagnostics;
|
2014-05-24 23:15:16 -05:00
|
|
|
|
2014-07-04 21:41:54 -05:00
|
|
|
pub mod back {
|
|
|
|
pub use rustc_back::abi;
|
2014-07-06 23:50:37 -05:00
|
|
|
pub use rustc_back::archive;
|
2014-07-04 21:41:54 -05:00
|
|
|
pub use rustc_back::arm;
|
|
|
|
pub use rustc_back::mips;
|
|
|
|
pub use rustc_back::mipsel;
|
2014-07-06 20:01:16 -05:00
|
|
|
pub use rustc_back::rpath;
|
2014-07-04 21:41:54 -05:00
|
|
|
pub use rustc_back::svh;
|
|
|
|
pub use rustc_back::target_strs;
|
|
|
|
pub use rustc_back::x86;
|
|
|
|
pub use rustc_back::x86_64;
|
|
|
|
}
|
|
|
|
|
2013-01-29 17:16:07 -06:00
|
|
|
pub mod middle {
|
2014-07-13 08:12:47 -05:00
|
|
|
pub mod astencode;
|
|
|
|
pub mod borrowck;
|
|
|
|
pub mod cfg;
|
|
|
|
pub mod check_const;
|
2014-09-14 19:21:25 -05:00
|
|
|
pub mod check_static_recursion;
|
2013-01-29 17:16:07 -06:00
|
|
|
pub mod check_loop;
|
|
|
|
pub mod check_match;
|
2014-09-01 22:55:07 -05:00
|
|
|
pub mod check_rvalues;
|
2014-02-26 12:22:41 -06:00
|
|
|
pub mod check_static;
|
2014-07-13 08:12:47 -05:00
|
|
|
pub mod const_eval;
|
2013-04-17 17:05:17 -05:00
|
|
|
pub mod dataflow;
|
2014-07-13 08:12:47 -05:00
|
|
|
pub mod dead;
|
|
|
|
pub mod def;
|
|
|
|
pub mod dependency_format;
|
|
|
|
pub mod effect;
|
|
|
|
pub mod entry;
|
|
|
|
pub mod expr_use_visitor;
|
2014-11-16 05:33:31 -06:00
|
|
|
pub mod fast_reject;
|
2014-07-13 08:12:47 -05:00
|
|
|
pub mod graph;
|
|
|
|
pub mod intrinsicck;
|
2013-01-29 17:16:07 -06:00
|
|
|
pub mod lang_items;
|
2014-07-13 08:12:47 -05:00
|
|
|
pub mod liveness;
|
|
|
|
pub mod mem_categorization;
|
|
|
|
pub mod pat_util;
|
2013-01-29 17:16:07 -06:00
|
|
|
pub mod privacy;
|
2013-06-14 20:21:47 -05:00
|
|
|
pub mod reachable;
|
2014-07-13 08:12:47 -05:00
|
|
|
pub mod region;
|
|
|
|
pub mod resolve;
|
|
|
|
pub mod resolve_lifetime;
|
Add stability inheritance
This commit makes several changes to the stability index infrastructure:
* Stability levels are now inherited lexically, i.e., each item's
stability level becomes the default for any nested items.
* The computed stability level for an item is stored as part of the
metadata. When using an item from an external crate, this data is
looked up and cached.
* The stability lint works from the computed stability level, rather
than manual stability attribute annotations. However, the lint still
checks only a limited set of item uses (e.g., it does not check every
component of a path on import). This will be addressed in a later PR,
as part of issue #8962.
* The stability lint only applies to items originating from external
crates, since the stability index is intended as a promise to
downstream crates.
* The "experimental" lint is now _allow_ by default. This is because
almost all existing crates have been marked "experimental", pending
library stabilization. With inheritance in place, this would generate
a massive explosion of warnings for every Rust program.
The lint should be changed back to deny-by-default after library
stabilization is complete.
* The "deprecated" lint still warns by default.
The net result: we can begin tracking stability index for the standard
libraries as we stabilize, without impacting most clients.
Closes #13540.
2014-06-11 19:23:11 -05:00
|
|
|
pub mod stability;
|
2014-07-13 08:12:47 -05:00
|
|
|
pub mod subst;
|
2014-09-12 09:53:35 -05:00
|
|
|
pub mod traits;
|
2014-07-13 08:12:47 -05:00
|
|
|
pub mod ty;
|
|
|
|
pub mod ty_fold;
|
|
|
|
pub mod typeck;
|
|
|
|
pub mod weak_lang_items;
|
2011-04-19 18:40:46 -05:00
|
|
|
}
|
|
|
|
|
2013-01-29 17:16:07 -06:00
|
|
|
pub mod metadata;
|
2011-06-27 18:38:57 -05:00
|
|
|
|
2014-11-15 19:30:33 -06:00
|
|
|
pub mod session;
|
2010-06-23 23:03:09 -05:00
|
|
|
|
2014-05-26 16:48:54 -05:00
|
|
|
pub mod plugin;
|
2014-05-24 18:16:10 -05:00
|
|
|
|
2014-06-01 17:58:06 -05:00
|
|
|
pub mod lint;
|
|
|
|
|
2013-01-29 17:16:07 -06:00
|
|
|
pub mod util {
|
2014-07-07 00:13:55 -05:00
|
|
|
pub use rustc_back::fs;
|
2014-07-07 00:21:04 -05:00
|
|
|
pub use rustc_back::sha2;
|
2014-07-07 00:13:55 -05:00
|
|
|
|
2013-01-29 17:16:07 -06:00
|
|
|
pub mod common;
|
|
|
|
pub mod ppaux;
|
2014-02-28 16:34:26 -06:00
|
|
|
pub mod nodemap;
|
2014-07-22 06:40:51 -05:00
|
|
|
pub mod snapshot_vec;
|
2010-08-18 13:34:47 -05:00
|
|
|
}
|
|
|
|
|
2013-01-29 17:16:07 -06:00
|
|
|
pub mod lib {
|
2014-07-05 15:24:57 -05:00
|
|
|
pub use llvm;
|
2010-07-12 19:47:40 -05:00
|
|
|
}
|
|
|
|
|
2014-07-01 11:39:41 -05:00
|
|
|
__build_diagnostic_array!(DIAGNOSTICS)
|
|
|
|
|
2014-06-04 16:35:58 -05:00
|
|
|
// 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;
|
|
|
|
}
|