summary refs log tree commit diff
path: root/src/librustc_plugin
AgeCommit message (Collapse)AuthorLines
2016-09-26Forbid user-defined macros named "macro_rules".Jeffrey Seyfried-0/+3
2016-09-23reviewer comments and rebasingNick Cameron-6/+2
2016-09-22Adds a `ProcMacro` form of syntax extensionNick Cameron-0/+2
This commit adds syntax extension forms matching the types for procedural macros 2.0 (RFC #1566), these still require the usual syntax extension boiler plate, but this is a first step towards proper implementation and should be useful for macros 1.1 stuff too. Supports both attribute-like and function-like macros.
2016-09-15Remove `MacroRulesTT`.Jeffrey Seyfried-5/+1
2016-09-04Auto merge of #36240 - leeopop:master, r=jseyfriedbors-2/+2
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-04Allow CompilerControllers to access rustc_plugin::registry::Registry structure.Keunhong Lee-2/+2
2016-09-02rustc: Implement custom derive (macros 1.1)Alex Crichton-1/+0
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-08-31Change 'rustc::plugin' to 'rustc_plugin' in doc commentChiu-Hsiang Hsu-1/+1
2016-08-25Refactor away `AttrMetaMethods`.Jeffrey Seyfried-1/+0
2016-08-25Refactor away `AttrNestedMetaItemMethods`.Jeffrey Seyfried-1/+1
2016-08-25Implement RFC#1559: allow all literals in attributes.Sergio Benitez-13/+12
2016-08-11Remove the 'cfg' field from session::config::Options.Michael Woerister-3/+7
The 'cfg' in the Options struct is only the commandline-specified subset of the crate configuration and it's almost always wrong to read that instead of the CrateConfig in HIR crate node.
2016-06-27Fix `Cargo.toml`sJeffrey Seyfried-1/+2
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-4/+7
2016-06-08remove the librustc_trans -> librustc_mir dependencyAriel Ben-Yehuda-2/+0
2016-05-25rustc: use a simpler scheme for plugin registrar symbol names.Eduard Burtescu-1/+2
2016-05-10fix Registry::args for plugins loaded with --extra-pluginsOliver Schneider-2/+5
2016-04-22Remove the MacroVisitor pass.Leo Testard-17/+22
This pass was supposed to check use of gated features before `#[cfg]`-stripping but this was not the case since it in fact happens after. Checks that are actually important and must be done before macro expansion are now made where the features are actually used. Close #32648. Also ensure that attributes on macro-generated macro invocations are checked as well. Close #32782 and #32655.
2016-04-06rustc: move rustc_front to rustc::hir.Eduard Burtescu-5/+3
2016-03-25Make the compiler emit an error if the crate graph contains two crates with ↵Michael Woerister-4/+7
the same crate-name and crate-salt but different SVHs.
2016-03-13Auto merge of #31916 - nagisa:mir-passmgr-2, r=arielb1bors-3/+3
Add Pass manager for MIR A new PR, since rebasing the original one (https://github.com/rust-lang/rust/pull/31448) properly was a pain. Since then there has been several changes most notable of which: 1. Removed the pretty-printing with `#[rustc_mir(graphviz/pretty)]`, mostly because we now have `--unpretty=mir`, IMHO that’s the direction we should expand this functionality into; 2. Reverted the infercx change done for typeck, because typeck can make an infercx for itself by being a `MirMapPass` r? @nikomatsakis
2016-03-12std: Clean out deprecated APIsAlex Crichton-3/+3
Removes all unstable and deprecated APIs prior to the 1.8 release. All APIs that are deprecated in the 1.8 release are sticking around for the rest of this cycle. Some notable changes are: * The `dynamic_lib` module was moved into `rustc_back` as the compiler still relies on a few bits and pieces. * The `DebugTuple` formatter now special-cases an empty struct name with only one field to append a trailing comma.
2016-03-04Add Pass manager for MIRSimonas Kazlauskas-3/+3
2016-02-21rustbuild: Sync some Cargo.toml/lib.rs dependenciesAlex Crichton-0/+1
The standard library doesn't depend on rustc_bitflags, so move it to explicit dependencies on all other crates. Additionally, the arena/fmt_macros deps could be dropped from libsyntax.
2016-02-12Autoderef in librustc_pluginJonas Schievink-1/+1
2016-02-11bootstrap: Add a bunch of Cargo.toml filesAlex Crichton-0/+17
These describe the structure of all our crate dependencies.
2016-02-09Allow registering MIR-passes through compiler pluginsOliver Schneider-0/+12
2016-02-05Instrument a bunch of tasks that employ the HIR map in one way orNiko Matsakis-1/+6
another and were not previously instrumented.
2016-01-24mk: Move from `-D warnings` to `#![deny(warnings)]`Alex Crichton-2/+3
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
2015-12-30use structured errorsNick Cameron-2/+3
2015-12-21Register new snapshotsAlex Crichton-2/+0
Lots of cruft to remove!
2015-12-17move error handling from libsyntax/diagnostics.rs to libsyntax/errors/*Nick Cameron-4/+4
Also split out emitters into their own module.
2015-11-26split the metadata code into rustc_metadataAriel Ben-Yehuda-2/+3
tests & rustdoc still broken
2015-11-26move librustc/plugin to librustc_pluginAriel Ben-Yehuda-0/+457
this is a [breaking-change] to all plugin authors - sorry