about summary refs log tree commit diff
path: root/src/librustc_plugin
AgeCommit message (Collapse)AuthorLines
2017-04-18kill a bunch of one off tasksNiko Matsakis-2/+0
2017-04-13remove `LinkMeta` from `SharedCrateContext`Niko Matsakis-2/+2
A number of things were using `crate_hash` that really ought to be using `crate_disambiguator` (e.g., to create the plugin symbol names). They have been updated. It is important to remove `LinkMeta` from `SharedCrateContext` since it contains a hash of the entire crate, and hence it will change whenever **anything** changes (which would then require rebuilding **everything**).
2017-03-29Merge `ExpnId` and `SyntaxContext`.Jeffrey Seyfried-2/+2
2017-03-27Fix various useless derefs and slicingsOliver Schneider-3/+3
2017-03-10Remove ability for plugins to register a MIR passSimonas Kazlauskas-11/+0
In recent months there have been a few different people investigating how to make a plugin that registers a MIR-pass – one that isn’t intended to be eventually merged into rustc proper. The interface to register MIR passes was added primarily for miri (& later was found to make prototyping of rustc-proper MIR passes a tiny bit faster). Since miri does not use this interface anymore it seems like a good time to remove this "feature". For prototyping purposes a similar interface can be added by developers themselves in their custom rustc build.
2017-01-22Remove unused `extern crate`s.Jeffrey Seyfried-2/+0
2017-01-22Warn on unused `#[macro_use]` imports.Jeffrey Seyfried-3/+1
2017-01-08Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrcbors-1/+1
Remove not(stage0) from deny(warnings) Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2016-12-29Remove not(stage0) from deny(warnings)Alex Crichton-1/+1
Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2016-12-29Fallout from updating bootstrap CargoAlex Crichton-0/+1
2016-12-28rustc: separate TraitItem from their parent Item, just like ImplItem.Eduard-Mihai Burtescu-0/+3
2016-12-23Allow legacy custom derive authors to disable warnings in downstream crates.Jeffrey Seyfried-0/+18
2016-11-21Cleanup `InternedString`.Jeffrey Seyfried-1/+1
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-2/+2
2016-11-20Refactor `MetaItemKind` to use `Name`s instead of `InternedString`s.Jeffrey Seyfried-2/+2
2016-11-16fallout from separating impl-items from implsNiko Matsakis-0/+3
Basically adding `visit_impl_item` in various places and so forth.
2016-11-16refactor Visitor into ItemLikeVisitor and intravisit::VisitorNiko Matsakis-3/+3
There are now three patterns (shallow, deep, and nested visit). These are described in detail on the docs in `itemlikevisit::ItemLikeVisitor`.
2016-10-31Changed most vec! invocations to use square bracesiirelu-5/+5
Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-10-29Move `CrateConfig` from `Crate` to `ParseSess`.Jeffrey Seyfried-7/+3
2016-10-22Remove `CrateReader`, use `CrateLoader` instead.Jeffrey Seyfried-3/+3
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