about summary refs log tree commit diff
path: root/src/librustc_driver
AgeCommit message (Collapse)AuthorLines
2016-10-10Error monitor should emit error to stderr instead of stdoutNick Cameron-1/+1
2016-10-07Refactor away `ext::expand::{expand_crate, expand_crate_with_expander}`.Jeffrey Seyfried-2/+8
2016-10-07Add macros from plugins in `libsyntax_ext::register_builtins`.Jeffrey Seyfried-2/+2
2016-10-06rustc: Rename rustc_macro to proc_macroAlex Crichton-14/+14
This commit blanket renames the `rustc_macro` infrastructure to `proc_macro`, which reflects the general consensus of #35900. A follow up PR to Cargo will be required to purge the `rustc-macro` name as well.
2016-10-03Auto merge of #36847 - alexcrichton:rustc-macro-doc, r=nrcbors-12/+17
rustdoc: Fix documenting rustc-macro crates This commit adds a "hack" to the session to track whether we're a rustdoc session or not. If we're rustdoc then we skip the expansion to add the rustc-macro infrastructure. Closes #36820
2016-09-30Change the sigs of set_print/set_panic to allow restoring the default objectsBrian Anderson-2/+2
2016-09-30rustdoc: Fix documenting rustc-macro cratesAlex Crichton-12/+17
This commit adds a "hack" to the session to track whether we're a rustdoc session or not. If we're rustdoc then we skip the expansion to add the rustc-macro infrastructure. Closes #36820
2016-09-28Rollup merge of #36760 - nrc:input2, r=alexcrichtonJonathan Turner-19/+20
Allow supplying an error destination via the compiler driver Allows replacing stderr with a buffer from the client. Also, some refactoring around run_compiler.
2016-09-28Allow supplying an error destination via the compiler driverNick Cameron-19/+20
Allows replacing stderr with a buffer from the client. Also, some refactoring around run_compiler.
2016-09-27Build the reduced graph during expansion.Jeffrey Seyfried-7/+6
2016-09-27Peform def id assignment during expansion.Jeffrey Seyfried-3/+0
2016-09-26appease tidyTim Neumann-1/+2
2016-09-26deduplicate inline is_nightly_build implementationsTim Neumann-4/+1
2016-09-26refactor away get_unstable_features_settingTim Neumann-2/+2
2016-09-24Load macros from `#[macro_use]` extern crates in `resolve`.Jeffrey Seyfried-0/+3
2016-09-23Load extern crates in `resolve`.Jeffrey Seyfried-11/+3
2016-09-22Refactor `no_implicit_prelude: Cell<bool>` -> `no_implicit_prelude: bool`.Jeffrey Seyfried-1/+2
2016-09-21Auto merge of #36551 - eddyb:meta-games, r=nikomatsakisbors-9/+11
Refactor away RBML from rustc_metadata. RBML and `ty{en,de}code` have had their long-overdue purge. Summary of changes: * Metadata is now a tree encoded in post-order and with relative backward references pointing to children nodes. With auto-deriving and type safety, this makes maintenance and adding new information to metadata painless and bug-free by default. It's also more compact and cache-friendly (cache misses should be proportional to the depth of the node being accessed, not the number of siblings as in EBML/RBML). * Metadata sizes have been reduced, for `libcore` it went down 16% (`8.38MB` -> `7.05MB`) and for `libstd` 14% (`3.53MB` -> `3.03MB`), while encoding more or less the same information * Specialization is used in the bundled `libserialize` (crates.io `rustc_serialize` remains unaffected) to customize the encoding (and more importantly, decoding) of various types, most notably those interned in the `TyCtxt`. Some of this abuses a soundness hole pending a fix (cc @aturon), but when that fix arrives, we'll move to macros 1.1 `#[derive]` and custom `TyCtxt`-aware serialization traits. * Enumerating children of modules from other crates is now orthogonal to describing those items via `Def` - this is a step towards bridging crate-local HIR and cross-crate metadata * `CrateNum` has been moved to `rustc` and both it and `NodeId` are now newtypes instead of `u32` aliases, for specializing their decoding. This is `[syntax-breaking]` (cc @Manishearth ). cc @rust-lang/compiler
2016-09-20rustc_metadata: go only through rustc_serialize in astencode.Eduard Burtescu-9/+11
2016-09-20Auto merge of #36388 - pcwalton:copy-propagation, r=nikomatsakisbors-0/+1
librustc_mir: Implement def-use chains and trivial copy propagation on MIR. This only supports trivial cases in which there is exactly one def and one use. Currently, some random unrelated MIR tests are failing, probably just because they haven't been updated. r? @eddyb
2016-09-19librustc: Implement def-use chains and trivial copy propagation on MIR.Patrick Walton-0/+1
This only supports trivial cases in which there is exactly one def and one use.
2016-09-19Auto merge of #36102 - GuillaumeGomez:rustc_metadata_diagnostics, ↵bors-0/+1
r=jonathandturner Rustc metadata diagnostics r? @jonathandturner
2016-09-17Auto merge of #36504 - pcwalton:and-star, r=eddybbors-0/+3
librustc_mir: Remove `&*x` when `x` has a reference type. This introduces a new `InstCombine` pass for us to place such peephole optimizations. r? @eddyb
2016-09-16Auto merge of #36444 - jseyfried:macro_rules_ext, r=nrcbors-1/+1
Remove variant `MacroRulesTT` of `SyntaxExtension` r? @nrc
2016-09-16librustc_mir: Remove `&*x` when `x` has a reference type.Patrick Walton-0/+3
This introduces a new `InstCombine` pass for us to place such peephole optimizations.
2016-09-15Move fields `single_step` and `keep_macs` from `MacroExpander` to ↵Jeffrey Seyfried-1/+1
`ExpansionConfig`.
2016-09-15Default RUST_MIN_STACK to 16MiB for nowSimonas Kazlauskas-1/+2
2016-09-13Expand generated test harnesses and macro registries.Jeffrey Seyfried-0/+2
2016-09-13Perform node id assignment and `macros_at_scope` construction duringJeffrey Seyfried-2/+0
the `InvocationCollector` and `PlaceholderExpander` folds.
2016-09-13Move macro resolution into `librustc_resolve`.Jeffrey Seyfried-6/+3
2016-09-13Refactor `ExtCtxt` to use a `Resolver` instead of a `MacroLoader`.Jeffrey Seyfried-8/+7
2016-09-07Auto merge of #36214 - jseyfried:stackless_expansion, r=nrcbors-16/+4
macros: stackless expansion After this PR, macro expansion cannot overflow the stack unless the expanded crate is too deep to fold. Everything but the stackless placeholder expansion commit is also groundwork for macro modularization. r? @nrc or @eddyb
2016-09-06Auto merge of #36025 - michaelwoerister:incr-comp-hash-spans, r=nikomatsakisbors-0/+4
incr. comp.: Take spans into account for ICH This PR makes the ICH (incr. comp. hash) take spans into account when debuginfo is enabled. A side-effect of this is that the SVH (which is based on the ICHs of all items in the crate) becomes sensitive to the tiniest change in a code base if debuginfo is enabled. Since we are not trying to model ABI compatibility via the SVH anymore (this is done via the crate disambiguator now), this should be not be a problem. Fixes #33888. Fixes #32753.
2016-09-05Remove `syntax::config::strip_unconfigured`, add `syntax::config::features`.Jeffrey Seyfried-16/+4
2016-09-04Auto merge of #36240 - leeopop:master, r=jseyfriedbors-5/+10
Allow CompilerControllers to access rustc_plugin::registry::Registry fixes #36064 I chose to put ructc_plugin::registry::Registry structure into CompilerState structure, instead of Session structure. This will preserve dependencies among librustc, libructc_driver, and libructc_plugin. @jseyfried @sanxiyn
2016-09-04Auto merge of #36203 - petrochenkov:uvsdot, r=nrcbors-2/+3
Replace `_, _` with `..` in patterns This is how https://github.com/rust-lang/rust/issues/33627 looks in action. Looks especially nice in leftmost/rightmost positions `(first, ..)`/`(.., last)`. I haven't touched libsyntax intentionally because the feature is still unstable.
2016-09-04Auto merge of #36132 - nrc:save-std, r=@eddybbors-2/+6
Add --Zsave-analysis-api This is a save-analysis variation which can be used with libraries distributed without their source (e.g., libstd). It will allow IDEs and other tools to get info about types and create URLs to docs and source, without the unnecessary clutter of internal-only save-analysis info. I'm sure we'll iterate somewhat on the design, but this is a first draft.
2016-09-04Replace `_, _` with `..`Vadim Petrochenkov-2/+3
2016-09-04Allow CompilerControllers to access rustc_plugin::registry::Registry structure.Keunhong Lee-5/+10
2016-09-04Add librustc metadata error codes to global checkggomez-0/+1
2016-09-03Some better support for unions through the compilerVadim Petrochenkov-0/+1
2016-09-02rustc: Implement custom derive (macros 1.1)Alex Crichton-1/+56
This commit is an implementation of [RFC 1681] which adds support to the compiler for first-class user-define custom `#[derive]` modes with a far more stable API than plugins have today. [RFC 1681]: https://github.com/rust-lang/rfcs/blob/master/text/1681-macros-1.1.md The main features added by this commit are: * A new `rustc-macro` crate-type. This crate type represents one which will provide custom `derive` implementations and perhaps eventually flower into the implementation of macros 2.0 as well. * A new `rustc_macro` crate in the standard distribution. This crate will provide the runtime interface between macro crates and the compiler. The API here is particularly conservative right now but has quite a bit of room to expand into any manner of APIs required by macro authors. * The ability to load new derive modes through the `#[macro_use]` annotations on other crates. All support added here is gated behind the `rustc_macro` feature gate, both for the library support (the `rustc_macro` crate) as well as the language features. There are a few minor differences from the implementation outlined in the RFC, such as the `rustc_macro` crate being available as a dylib and all symbols are `dlsym`'d directly instead of having a shim compiled. These should only affect the implementation, however, not the public interface. This commit also ended up touching a lot of code related to `#[derive]`, making a few notable changes: * Recognized derive attributes are no longer desugared to `derive_Foo`. Wasn't sure how to keep this behavior and *not* expose it to custom derive. * Derive attributes no longer have access to unstable features by default, they have to opt in on a granular level. * The `derive(Copy,Clone)` optimization is now done through another "obscure attribute" which is just intended to ferry along in the compiler that such an optimization is possible. The `derive(PartialEq,Eq)` optimization was also updated to do something similar. --- One part of this PR which needs to be improved before stabilizing are the errors and exact interfaces here. The error messages are relatively poor quality and there are surprising spects of this such as `#[derive(PartialEq, Eq, MyTrait)]` not working by default. The custom attributes added by the compiler end up becoming unstable again when going through a custom impl. Hopefully though this is enough to start allowing experimentation on crates.io! syntax-[breaking-change]
2016-09-01Add some infrastructure for timing things where time_passes can't be used.Michael Woerister-0/+4
2016-09-01save-analysis: add parent info to api dumpsNick Cameron-1/+2
The parent id is used for constructing rustdoc URLs by clients
2016-09-01save-analsysis: add save-analysis-api CLI flagNick Cameron-1/+4
2016-08-31Auto merge of #35718 - michaelwoerister:incr-comp-dir-locking, r=alexcrichtonbors-8/+12
Implement synchronization scheme for incr. comp. directory This PR implements a copy-on-write-based synchronization scheme for the incremental compilation cache directory. For technical details, see the documentation at the beginning of `rustc_incremental/persist/fs.rs`. The PR contains unit tests for some functions but for testing whether the scheme properly handles races, a more elaborate test setup would be needed. It would probably involve a small tool that allows to manipulate the incremental compilation directory in a controlled way and then letting a compiler instance run against directories in different states. I don't know if it's worth the trouble of adding another test category to `compiletest`, but I'd be happy to do so. Fixes #32754 Fixes #34957
2016-08-29Implement copy-on-write scheme for managing the incremental compilation cache.Michael Woerister-8/+12
2016-08-28Rollup merge of #35917 - jseyfried:remove_attr_ext_traits, r=nrcJeffrey Seyfried-2/+1
syntax: Remove traits `AttrMetaMethods`, `AttributeMethods`, and `AttrNestedMetaItemMethods`
2016-08-28Rollup merge of #35850 - SergioBenitez:master, r=nrcJeffrey Seyfried-5/+7
Implement RFC#1559: allow all literals in attributes Implemented rust-lang/rfcs#1559, tracked by #34981.
2016-08-27rustc: use Vec<Kind> in Substs, where Kind is a &TyS | &Region tagged pointer.Eduard Burtescu-4/+5