2013-02-28 13:15:32 +00:00
|
|
|
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
|
2012-12-03 16:48:01 -08: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 21:17:11 -05:00
|
|
|
//! The Rust compiler.
|
|
|
|
//!
|
|
|
|
//! # Note
|
|
|
|
//!
|
|
|
|
//! This API is completely unstable and subject to change.
|
2014-01-07 21:17:52 -08:00
|
|
|
|
2014-07-01 07:12:04 -07:00
|
|
|
#![crate_name = "rustc"]
|
2015-08-13 10:21:36 -07:00
|
|
|
#![unstable(feature = "rustc_private", issue = "27812")]
|
2014-03-21 18:05:05 -07:00
|
|
|
#![crate_type = "dylib"]
|
|
|
|
#![crate_type = "rlib"]
|
2015-08-09 14:15:05 -07:00
|
|
|
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
|
2016-01-21 15:26:19 -08:00
|
|
|
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))]
|
2011-05-05 22:44:00 -04:00
|
|
|
|
2015-04-28 16:36:22 -07:00
|
|
|
#![feature(associated_consts)]
|
2015-02-10 22:52:44 +01:00
|
|
|
#![feature(box_patterns)]
|
2015-01-07 15:15:34 +01:00
|
|
|
#![feature(box_syntax)]
|
2015-01-22 18:22:03 -08:00
|
|
|
#![feature(collections)]
|
2015-05-29 09:42:32 -04:00
|
|
|
#![feature(const_fn)]
|
2016-02-23 19:25:43 +01:00
|
|
|
#![feature(copy_from_slice)]
|
2015-06-09 14:39:23 -07:00
|
|
|
#![feature(enumset)]
|
2015-06-10 13:33:52 -07:00
|
|
|
#![feature(iter_arith)]
|
2015-01-22 18:22:03 -08:00
|
|
|
#![feature(libc)]
|
2015-07-22 20:10:18 +03:00
|
|
|
#![feature(nonzero)]
|
2015-01-30 12:26:44 -08:00
|
|
|
#![feature(quote)]
|
|
|
|
#![feature(rustc_diagnostic_macros)]
|
2015-01-22 18:22:03 -08:00
|
|
|
#![feature(rustc_private)]
|
2015-04-28 16:36:22 -07:00
|
|
|
#![feature(slice_patterns)]
|
2015-01-30 12:26:44 -08:00
|
|
|
#![feature(staged_api)]
|
2015-03-10 16:29:02 -07:00
|
|
|
#![feature(str_char)]
|
2016-03-21 02:23:03 -05:00
|
|
|
#![feature(question_mark)]
|
2015-01-24 09:15:42 -08:00
|
|
|
#![cfg_attr(test, feature(test))]
|
2015-03-06 15:11:59 -08:00
|
|
|
|
2014-02-14 10:10:06 -08:00
|
|
|
extern crate arena;
|
2015-07-22 20:10:18 +03:00
|
|
|
extern crate core;
|
2014-05-22 11:28:01 -07:00
|
|
|
extern crate flate;
|
2015-01-10 23:51:27 +05:30
|
|
|
extern crate fmt_macros;
|
2014-05-22 11:28:01 -07:00
|
|
|
extern crate getopts;
|
2014-04-17 21:00:08 +02:00
|
|
|
extern crate graphviz;
|
2014-05-22 11:28:01 -07:00
|
|
|
extern crate libc;
|
2015-12-01 16:07:15 +01:00
|
|
|
extern crate rbml;
|
2014-09-06 11:54:11 -07:00
|
|
|
extern crate rustc_back;
|
2015-07-31 00:04:06 -07:00
|
|
|
extern crate rustc_front;
|
2015-04-07 06:10:53 -04:00
|
|
|
extern crate rustc_data_structures;
|
2014-02-14 10:10:06 -08:00
|
|
|
extern crate serialize;
|
2014-12-17 10:16:10 -05:00
|
|
|
extern crate collections;
|
2015-12-16 18:44:15 +01:00
|
|
|
extern crate rustc_const_eval;
|
2015-01-06 09:24:46 -08:00
|
|
|
#[macro_use] extern crate log;
|
|
|
|
#[macro_use] extern crate syntax;
|
2015-01-16 12:20:03 -08:00
|
|
|
#[macro_use] #[no_link] extern crate rustc_bitflags;
|
2014-07-01 18:39:41 +02:00
|
|
|
|
2015-03-24 18:13:54 -07:00
|
|
|
extern crate serialize as rustc_serialize; // used by deriving
|
2014-12-18 22:52:48 -08:00
|
|
|
|
2014-07-29 16:31:39 -07:00
|
|
|
#[cfg(test)]
|
|
|
|
extern crate test;
|
|
|
|
|
2015-04-17 15:32:42 -07:00
|
|
|
#[macro_use]
|
|
|
|
mod macros;
|
|
|
|
|
2015-01-16 15:54:58 -08:00
|
|
|
// NB: This module needs to be declared first so diagnostics are
|
|
|
|
// registered before they are used.
|
|
|
|
pub mod diagnostics;
|
2014-05-24 21:15:16 -07:00
|
|
|
|
2014-07-04 19:41:54 -07:00
|
|
|
pub mod back {
|
2014-07-06 18:01:16 -07:00
|
|
|
pub use rustc_back::rpath;
|
2014-07-04 19:41:54 -07:00
|
|
|
pub use rustc_back::svh;
|
|
|
|
}
|
|
|
|
|
2016-03-22 17:30:57 +02:00
|
|
|
pub mod cfg;
|
2016-01-05 13:02:57 -05:00
|
|
|
pub mod dep_graph;
|
|
|
|
|
2015-07-31 00:04:06 -07:00
|
|
|
pub mod front {
|
2015-09-25 15:25:59 +09:00
|
|
|
pub mod check_attr;
|
2015-07-31 00:04:06 -07:00
|
|
|
pub mod map;
|
|
|
|
}
|
2015-06-10 02:40:45 +03:00
|
|
|
|
2016-03-22 17:30:57 +02:00
|
|
|
pub mod infer;
|
|
|
|
pub mod lint;
|
|
|
|
|
2013-01-29 15:16:07 -08:00
|
|
|
pub mod middle {
|
2014-11-26 04:52:02 -05:00
|
|
|
pub mod astconv_util;
|
2015-11-22 22:14:09 +02:00
|
|
|
pub mod expr_use_visitor; // STAGE0: increase glitch immunity
|
2013-01-29 15:16:07 -08:00
|
|
|
pub mod check_match;
|
2014-07-13 15:12:47 +02:00
|
|
|
pub mod const_eval;
|
2016-01-21 10:52:37 +01:00
|
|
|
pub mod const_qualif;
|
2015-11-25 00:00:26 +02:00
|
|
|
pub mod cstore;
|
2013-04-17 18:05:17 -04:00
|
|
|
pub mod dataflow;
|
2014-07-13 15:12:47 +02:00
|
|
|
pub mod dead;
|
|
|
|
pub mod def;
|
2015-08-16 06:31:58 -04:00
|
|
|
pub mod def_id;
|
2014-07-13 15:12:47 +02:00
|
|
|
pub mod dependency_format;
|
|
|
|
pub mod effect;
|
|
|
|
pub mod entry;
|
2015-04-18 11:23:14 -04:00
|
|
|
pub mod free_region;
|
2014-07-13 15:12:47 +02:00
|
|
|
pub mod intrinsicck;
|
2013-01-29 15:16:07 -08:00
|
|
|
pub mod lang_items;
|
2014-07-13 15:12:47 +02:00
|
|
|
pub mod liveness;
|
|
|
|
pub mod mem_categorization;
|
|
|
|
pub mod pat_util;
|
2013-01-29 15:16:07 -08:00
|
|
|
pub mod privacy;
|
2013-06-14 18:21:47 -07:00
|
|
|
pub mod reachable;
|
2014-07-13 15:12:47 +02:00
|
|
|
pub mod region;
|
2014-12-02 12:57:38 -05:00
|
|
|
pub mod recursion_limit;
|
2014-07-13 15:12:47 +02:00
|
|
|
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 17:23:11 -07:00
|
|
|
pub mod stability;
|
2014-07-13 15:12:47 +02:00
|
|
|
pub mod weak_lang_items;
|
2011-04-19 16:40:46 -07:00
|
|
|
}
|
|
|
|
|
2015-11-19 16:37:34 +01:00
|
|
|
pub mod mir {
|
|
|
|
pub mod repr;
|
|
|
|
pub mod tcx;
|
2015-11-24 14:35:34 +01:00
|
|
|
pub mod visit;
|
2016-02-05 09:35:00 +01:00
|
|
|
pub mod transform;
|
2016-02-05 09:32:33 +01:00
|
|
|
pub mod mir_map;
|
2015-11-19 16:37:34 +01:00
|
|
|
}
|
|
|
|
|
2014-11-15 20:30:33 -05:00
|
|
|
pub mod session;
|
2016-03-22 17:30:57 +02:00
|
|
|
pub mod traits;
|
|
|
|
pub mod ty;
|
2014-06-01 15:58:06 -07:00
|
|
|
|
2013-01-29 15:16:07 -08:00
|
|
|
pub mod util {
|
2014-07-06 22:21:04 -07:00
|
|
|
pub use rustc_back::sha2;
|
2014-07-06 22:13:55 -07:00
|
|
|
|
2013-01-29 15:16:07 -08:00
|
|
|
pub mod common;
|
|
|
|
pub mod ppaux;
|
2014-02-28 14:34:26 -08:00
|
|
|
pub mod nodemap;
|
2015-04-17 15:32:42 -07:00
|
|
|
pub mod num;
|
2015-05-05 15:19:36 -07:00
|
|
|
pub mod fs;
|
2010-08-18 11:34:47 -07:00
|
|
|
}
|
|
|
|
|
2014-06-04 14:35:58 -07: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;
|
|
|
|
}
|
2015-04-28 12:48:22 +10:00
|
|
|
|
2015-08-11 11:48:43 -07:00
|
|
|
// 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();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-28 12:48:22 +10:00
|
|
|
// Build the diagnostics array at the end so that the metadata includes error use sites.
|
|
|
|
__build_diagnostic_array! { librustc, DIAGNOSTICS }
|