summary refs log tree commit diff
path: root/src/librustc_driver
AgeCommit message (Collapse)AuthorLines
2016-04-07Put in `-Z continue-parse-after-error`Felix S. Klock II-0/+4
This works by adding a boolean flag, `continue_after_error`, to `syntax::errors::Handler` that can be imperatively set to `true` or `false` via a new `fn set_continue_after_error`. The flag starts off true (since we generally try to recover from compiler errors, and `Handler` is shared across all phases). Then, during the `phase_1_parse_input`, we consult the setting of the `-Z continue-parse-after-error` debug flag to determine whether we should leave the flag set to `true` or should change it to `false`. ---- (We might consider adding a debugflag to do such aborts in other places where we are currently attempting recovery, such as resolve, but I think the parser is the really important case to handle in the face of #31994 and the parser bugs of varying degrees that were injected by parse error recovery.)
2016-02-27Auto merge of #31915 - nagisa:mir-unpretty-fix, r=arielb1bors-12/+13
Fixes https://github.com/rust-lang/rust/issues/31913
2016-02-27Fix MIR unpretty on failure conditionsSimonas Kazlauskas-12/+13
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-20fix a few remaining bugs - make check runs!Ariel Ben-Yehuda-8/+12
2016-02-14Implement --unpretty mirJonas Schievink-1/+49
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-4/+4
2016-02-12Use more autoderef in rustc_driverJonas Schievink-4/+4
2016-02-12Auto merge of #30726 - GuillaumeGomez:compile-fail, r=brsonbors-2/+2
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-12Auto merge of #31583 - petrochenkov:indi_ast, r=Manishearthbors-2/+2
cc #31487 plugin-[breaking-change] The AST part of https://github.com/rust-lang/rust/pull/30087 r? @Manishearth
2016-02-11Remove some unnecessary indirection from AST structuresVadim Petrochenkov-2/+2
2016-02-11bootstrap: Add a bunch of Cargo.toml filesAlex Crichton-0/+33
These describe the structure of all our crate dependencies.
2016-02-11fixup: meta item kindOliver Schneider-1/+1
2016-02-11[breaking-change] don't glob export ast::TraitItemKind variantsOliver 'ker' 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 glob export ast::Item_ variantsOliver 'ker' Schneider-4/+4
2016-02-11[breaking-change] don't pub export ast::Lit_ variantsOliver Schneider-1/+1
2016-02-11[breaking-change] don't glob export ast::Expr_ variantsOliver Schneider-1/+1
2016-02-11[breaking-change] don't glob import/export syntax::abi enum variantsOliver Schneider-2/+3
2016-02-11[breaking-change] don't glob export ast::BlockCheckMode variantsOliver Schneider-2/+2
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-09Allow registering MIR-passes through compiler pluginsOliver Schneider-2/+7
2016-02-09make `MirMap` a struct instead of a type alias for `NodeMap`Oliver Schneider-1/+1
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-2/+2
2016-02-05Instrument a bunch of tasks that employ the HIR map in one way orNiko Matsakis-30/+46
another and were not previously instrumented.
2016-02-02Reviewer requested changes and test fixesNick Cameron-1/+1
2016-02-01Try to run compiler callbacks when we error outNick Cameron-75/+106
2016-02-01Replace some aborts with ResultsNick Cameron-25/+15
Fixes #31207 by removing abort_if_new_errors
2016-01-28Auto merge of #30411 - mitaa:multispan, r=nrcbors-3/+3
This allows to render multiple spans on one line, or to splice multiple replacements into a code suggestion. fixes #28124
2016-01-28Implement MultiSpan error reportingmitaa-3/+3
This allows to render multiple spans on one line, or to splice multiple replacements into a code suggestion.
2016-01-27Auto merge of #31206 - nrc:early-save, r=nikomatsakisbors-246/+294
r? @nikomatsakis
2016-01-26Auto merge of #31120 - alexcrichton:attribute-deny-warnings, r=brsonbors-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-26rebasingNick Cameron-2/+2
2016-01-26Initial work towards abort-free compilationNick Cameron-246/+294
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-22test falloutNick Cameron-11/+22
2016-01-22The war on abort_if_errorsNick Cameron-31/+33
2016-01-21move more checks out of librustcOliver Schneider-6/+7
2016-01-16Auto merge of #30533 - nikomatsakis:fulfillment-tree, r=aturonbors-1/+1
This PR introduces an `ObligationForest` data structure that the fulfillment context can use to track what's going on, instead of the current flat vector. This enables a number of improvements: 1. transactional support, at least for pushing new obligations 2. remove the "errors will be reported" hack -- instead, we only add types to the global cache once their entire subtree has been proven safe. Before, we never knew when this point was reached because we didn't track the subtree. - this in turn allows us to limit coinductive reasoning to structural traits, which sidesteps #29859 3. keeping the backtrace should allow for an improved error message, where we give the user full context - we can also remove chained obligation causes This PR is not 100% complete. In particular: - [x] Currently, types that embed themselves like `struct Foo { f: Foo }` give an overflow when evaluating whether `Foo: Sized`. This is not a very user-friendly error message, and this is a common beginner error. I plan to special-case this scenario, I think. - [x] I should do some perf. measurements. (Update: 2% regression.) - [x] More tests targeting #29859 - [ ] The transactional support is not fully integrated, though that should be easy enough. - [ ] The error messages are not taking advantage of the backtrace. I'd certainly like to do 1 through 3 before landing, but 4 and 5 could come as separate PRs. r? @aturon // good way to learn more about this part of the trait system f? @arielb1 // already knows this part of the trait system :)
2016-01-16only insert global predicates into the global cache once we'veNiko Matsakis-1/+1
completely proven them to be true
2016-01-16Auto merge of #30930 - oli-obk:fix/30887, r=arielb1bors-1/+6
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-1/+6
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`.