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-01-07 23:17:52 -06:00
|
|
|
/*!
|
|
|
|
|
|
|
|
The Rust compiler.
|
|
|
|
|
|
|
|
# Note
|
|
|
|
|
|
|
|
This API is completely unstable and subject to change.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
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-07-11 13:21:57 -05:00
|
|
|
html_root_url = "http://doc.rust-lang.org/master/")]
|
2011-05-05 21:44:00 -05:00
|
|
|
|
2014-03-21 20:05:05 -05:00
|
|
|
#![allow(deprecated)]
|
2014-06-17 18:00:04 -05:00
|
|
|
#![feature(macro_rules, globs, struct_variant, managed_boxes, quote)]
|
|
|
|
#![feature(default_type_params, phase, unsafe_destructor)]
|
2013-08-14 20:41:40 -05:00
|
|
|
|
2014-07-01 11:39:41 -05:00
|
|
|
#![allow(unknown_features)] // NOTE: Remove after next snapshot
|
|
|
|
#![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 debug;
|
|
|
|
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-07-05 15:24:57 -05:00
|
|
|
extern crate llvm = "rustc_llvm";
|
2014-07-04 21:41:54 -05:00
|
|
|
extern crate rustc_back = "rustc_back";
|
2014-02-14 12:10:06 -06:00
|
|
|
extern crate serialize;
|
2014-02-19 21:08:12 -06:00
|
|
|
extern crate time;
|
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;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
pub mod link;
|
|
|
|
pub mod lto;
|
|
|
|
|
|
|
|
}
|
|
|
|
>>>>>>> Extract librustc_back from librustc
|
|
|
|
|
2013-01-29 17:16:07 -06:00
|
|
|
pub mod middle {
|
2014-05-14 14:31:30 -05:00
|
|
|
pub mod def;
|
2013-06-12 18:18:58 -05:00
|
|
|
pub mod trans;
|
2013-01-29 17:16:07 -06:00
|
|
|
pub mod ty;
|
2013-10-29 05:03:32 -05:00
|
|
|
pub mod ty_fold;
|
Cleanup substitutions and treatment of generics around traits in a number of ways.
- In a TraitRef, use the self type consistently to refer to the Self type:
- trait ref in `impl Trait<A,B,C> for S` has a self type of `S`.
- trait ref in `A:Trait` has the self type `A`
- trait ref associated with a trait decl has self type `Self`
- trait ref associated with a supertype has self type `Self`
- trait ref in an object type `@Trait` has no self type
- Rewrite `each_bound_traits_and_supertraits` to perform
substitutions as it goes, and thus yield a series of trait refs
that are always in the same 'namespace' as the type parameter
bound given as input. Before, we left this to the caller, but
this doesn't work because the caller lacks adequare information
to perform the type substitutions correctly.
- For provided methods, substitute the generics involved in the provided
method correctly.
- Introduce TypeParameterDef, which tracks the bounds declared on a type
parameter and brings them together with the def_id and (in the future)
other information (maybe even the parameter's name!).
- Introduce Subst trait, which helps to cleanup a lot of the
repetitive code involved with doing type substitution.
- Introduce Repr trait, which makes debug printouts far more convenient.
Fixes #4183. Needed for #5656.
2013-04-09 00:54:49 -05:00
|
|
|
pub mod subst;
|
2013-01-29 17:16:07 -06:00
|
|
|
pub mod resolve;
|
2013-10-29 05:03:32 -05:00
|
|
|
pub mod resolve_lifetime;
|
2012-11-28 14:33:00 -06:00
|
|
|
pub mod typeck;
|
2013-01-29 17:16:07 -06:00
|
|
|
pub mod check_loop;
|
|
|
|
pub mod check_match;
|
|
|
|
pub mod check_const;
|
2014-02-26 12:22:41 -06:00
|
|
|
pub mod check_static;
|
2012-12-13 15:05:22 -06:00
|
|
|
pub mod borrowck;
|
2013-04-17 17:05:17 -05:00
|
|
|
pub mod dataflow;
|
2013-01-29 17:16:07 -06:00
|
|
|
pub mod mem_categorization;
|
|
|
|
pub mod liveness;
|
|
|
|
pub mod kind;
|
|
|
|
pub mod freevars;
|
|
|
|
pub mod pat_util;
|
|
|
|
pub mod region;
|
|
|
|
pub mod const_eval;
|
|
|
|
pub mod astencode;
|
|
|
|
pub mod lang_items;
|
|
|
|
pub mod privacy;
|
2013-04-29 16:56:05 -05:00
|
|
|
pub mod entry;
|
2013-05-23 21:12:16 -05:00
|
|
|
pub mod effect;
|
2013-06-14 20:21:47 -05:00
|
|
|
pub mod reachable;
|
2013-05-09 10:29:17 -05:00
|
|
|
pub mod graph;
|
2013-05-10 12:10:35 -05:00
|
|
|
pub mod cfg;
|
2013-12-08 01:55:27 -06:00
|
|
|
pub mod dead;
|
2014-04-21 18:21:53 -05:00
|
|
|
pub mod expr_use_visitor;
|
2014-05-02 02:59:27 -05:00
|
|
|
pub mod dependency_format;
|
2014-05-19 11:30:09 -05:00
|
|
|
pub mod weak_lang_items;
|
2014-02-04 22:31:33 -06:00
|
|
|
pub mod save;
|
2014-06-12 16:08:44 -05:00
|
|
|
pub mod intrinsicck;
|
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;
|
2011-04-19 18:40:46 -05:00
|
|
|
}
|
|
|
|
|
2013-01-29 17:16:07 -06:00
|
|
|
pub mod front {
|
|
|
|
pub mod config;
|
|
|
|
pub mod test;
|
2013-05-17 15:12:42 -05:00
|
|
|
pub mod std_inject;
|
2014-01-06 06:00:46 -06:00
|
|
|
pub mod assign_node_ids_and_map;
|
2013-10-02 20:10:16 -05:00
|
|
|
pub mod feature_gate;
|
2014-02-07 04:50:07 -06:00
|
|
|
pub mod show_span;
|
2010-06-23 23:03:09 -05:00
|
|
|
}
|
|
|
|
|
2013-01-29 17:16:07 -06:00
|
|
|
pub mod metadata;
|
2011-06-27 18:38:57 -05:00
|
|
|
|
2013-01-29 17:16:07 -06:00
|
|
|
pub mod driver;
|
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 {
|
|
|
|
pub mod common;
|
|
|
|
pub mod ppaux;
|
2013-12-09 15:56:53 -06:00
|
|
|
pub mod sha2;
|
2014-02-28 16:34:26 -06:00
|
|
|
pub mod nodemap;
|
2014-04-08 12:06:11 -05:00
|
|
|
pub mod fs;
|
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;
|
|
|
|
}
|
|
|
|
|
2013-01-29 17:16:07 -06:00
|
|
|
pub fn main() {
|
2014-06-26 01:15:14 -05:00
|
|
|
let args = std::os::args();
|
2014-05-14 23:39:11 -05:00
|
|
|
std::os::set_exit_status(driver::main_args(args.as_slice()));
|
2013-08-22 04:41:33 -05:00
|
|
|
}
|