summary refs log tree commit diff
path: root/src/librustc_driver/lib.rs
AgeCommit message (Collapse)AuthorLines
2016-02-24rustc: Refactor how unstable flags are handledAlex Crichton-52/+98
This commit adds support for *truly* unstable options in the compiler, as well as adding warnings for the start of the deprecation path of unstable-but-not-really options. Specifically, the following behavior is now in place for handling unstable options: * As before, an unconditional error is emitted if an unstable option is passed and the `-Z unstable-options` flag is not present. Note that passing another `-Z` flag does not require passing `-Z unstable-options` as well. * New flags added to the compiler will be in the `Unstable` category as opposed to the `UnstableButNotReally` category which means they will unconditionally emit an error when used on stable. * All current flags are in a category where they will emit warnings when used that the option will soon be a hard error. Also as before, it is intended that `-Z` is akin to `#![feature]` in a crate where it is required to unlock unstable functionality. A nightly compiler which is used without any `-Z` flags should only be exercising stable behavior.
2016-02-13Auto merge of #31358 - japaric:print-targets, r=alexcrichtonbors-0/+5
that prints a list of all the triples supported by the `--target` flag r? @alexcrichton
2016-02-13Auto merge of #31524 - jonas-schievink:autoderef, r=steveklabnikbors-1/+1
2016-02-12Use more autoderef in rustc_driverJonas Schievink-1/+1
2016-02-12Auto merge of #30726 - GuillaumeGomez:compile-fail, r=brsonbors-1/+1
r? @brson cc @alexcrichton I still need to add error code explanation test with this, but I can't figure out a way to generate the `.md` files in order to test example source codes. Will fix #27328.
2016-02-12rustc: add a `--print target-list` commandJorge Aparicio-0/+5
2016-02-11fixup: meta item kindOliver Schneider-1/+1
2016-02-11[breaking-change] don't glob export ast::MetaItem_Oliver 'ker' Schneider-5/+5
2016-02-11[breaking-change] don't pub export ast::Lit_ variantsOliver Schneider-1/+1
2016-02-10Auto merge of #31499 - kamalmarhubi:cfg-flag-invalid-cfgs, r=brsonbors-21/+60
A spec like `#[cfg(foo(bar))]` is not allowed as an attribute. This makes the same spec be rejected by the compiler if passed in as a `--cfg` argument. Fixes #31495
2016-02-08driver: Include invalid predicate in error messageKamal Marhubi-5/+20
2016-02-08rustc: Implement a new `--print cfg` flagAlex Crichton-0/+19
This commit is an implementation of the new compiler flags required by [RFC 1361][rfc]. This specifically adds a new `cfg` option to the `--print` flag to the compiler. This new directive will print the defined `#[cfg]` directives by the compiler for the target in question. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1361-cargo-cfg-dependencies.md
2016-02-08driver: Disallow predicates in --cfg specsKamal Marhubi-1/+16
A spec like `#[cfg(foo(bar))]` is not allowed as an attribute. This makes the same spec be rejected by the compiler if passed in as a `--cfg` argument. Fixes #31495
2016-02-08driver: Extract handling of --explain to separate functionKamal Marhubi-20/+23
2016-02-08driver: Pass session options to CompilerCallbacks::early_callback()Kamal Marhubi-1/+7
2016-02-07Add compile-fail test in rustdocGuillaume Gomez-1/+1
2016-02-01Try to run compiler callbacks when we error outNick Cameron-6/+11
2016-02-01Replace some aborts with ResultsNick Cameron-13/+1
Fixes #31207 by removing abort_if_new_errors
2016-01-27Auto merge of #31206 - nrc:early-save, r=nikomatsakisbors-13/+60
r? @nikomatsakis
2016-01-26Initial work towards abort-free compilationNick Cameron-13/+60
The goal is that the compiler will pass `Result`s around rather than using abort_if_errors. To preserve behaviour we currently abort at the top level. I've removed all other aborts from the driver, but haven't touched any of the nested aborts.
2016-01-24mk: Move from `-D warnings` to `#![deny(warnings)]`Alex Crichton-0/+1
This commit removes the `-D warnings` flag being passed through the makefiles to all crates to instead be a crate attribute. We want these attributes always applied for all our standard builds, and this is more amenable to Cargo-based builds as well. Note that all `deny(warnings)` attributes are gated with a `cfg(stage0)` attribute currently to match the same semantics we have today
2016-01-16Auto merge of #30930 - oli-obk:fix/30887, r=arielb1bors-0/+1
this makes sure the checks run before typeck (which might use the constant or const function to calculate an array length) and gives prettier error messages in case of for loops and such (since they aren't expanded yet). fixes #30887 r? @pnkfelix
2016-01-15move const block checks before lowering stepOliver Schneider-0/+1
this makes sure the checks run before typeck (which might use the constant or const function to calculate an array length) and gives prettier error messages in case of for loops and such (since they aren't expanded yet).
2016-01-15Address reviewer commentsNick Cameron-3/+3
[breaking-change] `OptLevel` variants are no longer `pub use`ed by rust::session::config. If you are using these variants, you must change your code to prefix the variant name with `OptLevel`.
2016-01-15Add an --output option for specifying an error emitterNick Cameron-11/+12
2016-01-11Replace --show-span with -Z show-spanMatt Kraai-5/+2
2016-01-06std::cmp::max -> maxMike Anderson-6/+6
2016-01-04Add mention of warnings lint group to help messageMike Anderson-0/+4
2015-12-21Register new snapshotsAlex Crichton-26/+4
Lots of cruft to remove!
2015-12-17move error handling from libsyntax/diagnostics.rs to libsyntax/errors/*Nick Cameron-13/+12
Also split out emitters into their own module.
2015-12-15Move built-in syntax extensions to a separate crateSeo Sanghyeon-0/+1
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-7/+6
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-11-26fix tidyAriel Ben-Yehuda-1/+4
2015-11-26split the metadata code into rustc_metadataAriel Ben-Yehuda-4/+5
tests & rustdoc still broken
2015-11-26move librustc/plugin to librustc_pluginAriel Ben-Yehuda-0/+1
this is a [breaking-change] to all plugin authors - sorry
2015-11-26make CrateStore a trait objectAriel Ben-Yehuda-4/+28
rustdoc still broken
2015-11-25Remove all uses of `#[staged_api]`Vadim Petrochenkov-1/+1
2015-11-22Register diagnostics for rustc_privacy and rustc_trans properlyManish Goregaokar-0/+2
fixes #29665
2015-11-10Rustfmting librustc_driver.Jose Narvaez-125/+155
2015-11-07Fixed text alignment for output of "rustc -Z help"inrustwetrust-12/+18
2015-10-21save-analysis: don't recompute crate nameNick Cameron-0/+1
2015-10-09Add a lowering contextNick Cameron-0/+1
2015-10-07Make `--explain` Handle Partial Error CodesWill Speak-1/+6
Currently the explain command requires full erorr codes, complete with the leading zeros and the E at the beginning. This commit changes that, if you don't supply a full erorr code then the error number is padded out to the required size and the E is added to the beginning. This means that where previously you would need to write E0001, you can now write 0001, 001, 01 or jsut 1 to refer to the same error.
2015-09-30rustc: Support output filenames for each emit typeAlex Crichton-2/+2
Currently the compiler supports the ability to emit multiple output types as part of one compilation (e.g. asm, LLVM IR, bytecode, link, dep-info, etc). It does not, however, support the ability to customize the output filename for each of these output types. The `-o` flag is ignored if multiple emit types are specified (and the compiler emits a warning about this). Normally this doesn't matter too much, but in the case of `dep-info` it can lead to a number of problems (e.g. see #28716). By allowing customization of the output filename for each emit type we're able to solve the problems in that issue. This commit adds support for the `--emit` option to the compiler to look like: rustc foo.rs --emit dep-info=.deps/foo.d,link This indicates that the `dep-info` output type will be placed at `.deps/foo.d` and the `link` output type will otherwise be determined via the `--out-dir` and `-o` flags. Closes #28716
2015-09-06add MIR crate and link it into the driverNiko Matsakis-0/+1
2015-09-03Add an intital HIR and lowering stepNick Cameron-0/+2
2015-08-25Respect `--color` when printing early errorsBarosl Lee-13/+16
Currently, `early_error` and `early_warn` in `librustc::session` always use `ColorConfig::Auto`. Modify them to follow the color configuration set by the `--color` option. As colored output is also printed during the early stage, parsing the `--color` option should be done as early as possible. However, there are still some cases when the output needs to be colored before knowing the exact color settings. In these cases, it will be defaulted to `ColorConfig::Auto`, which is the same as before. Fixes #27879.
2015-08-17Add some SIMD target_feature cfg's when appropriate.Huon Wilson-1/+3
NB. this may not be 100% perfect.
2015-08-15Add issue for the rustc_private feature everywhereAlex Crichton-1/+1
2015-08-14rustc: Allow changing the default allocatorAlex Crichton-4/+4
This commit is an implementation of [RFC 1183][rfc] which allows swapping out the default allocator on nightly Rust. No new stable surface area should be added as a part of this commit. [rfc]: https://github.com/rust-lang/rfcs/pull/1183 Two new attributes have been added to the compiler: * `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to indicate that it requires an allocator crate to be in scope. * `#![allocator]` - this is a indicator that the crate is an allocator which can satisfy the `needs_allocator` attribute above. The ABI of the allocator crate is defined to be a set of symbols that implement the standard Rust allocation/deallocation functions. The symbols are not currently checked for exhaustiveness or typechecked. There are also a number of restrictions on these crates: * An allocator crate cannot transitively depend on a crate that is flagged as needing an allocator (e.g. allocator crates can't depend on liballoc). * There can only be one explicitly linked allocator in a final image. * If no allocator is explicitly requested one will be injected on behalf of the compiler. Binaries and Rust dylibs will use jemalloc by default where available and staticlibs/other dylibs will use the system allocator by default. Two allocators are provided by the distribution by default, `alloc_system` and `alloc_jemalloc` which operate as advertised. Closes #27389