about summary refs log tree commit diff
path: root/src/librustc_plugin/registry.rs
AgeCommit message (Collapse)AuthorLines
2019-11-17Rename directory `rustc_plugin` -> `rustc_plugin_impl`Vadim Petrochenkov-96/+0
2019-11-16rustc_plugin: Remove `Registry::register_attribute`Vadim Petrochenkov-13/+0
2019-11-09Remove `#[feature(custom_attribute)]`Vadim Petrochenkov-1/+0
2019-10-22Add some documentationMark Rousskov-0/+1
2019-10-17Create lint store during plugin registrationMark Rousskov-45/+5
Remove lint store from Session
2019-10-17Take lint passes as constructor functionsMark Rousskov-4/+4
2019-10-17Make get_lints be a static functionMark Rousskov-0/+9
This moves from calling get_lints on instantiated pass objects to the raw object
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-2/+2
2019-07-07syntax: Remove `NodeId` from `SyntaxExtension`Vadim Petrochenkov-4/+1
2019-07-04Rollup merge of #62258 - petrochenkov:idclean, r=CentrilMazdak Farrokhzad-4/+1
syntax: Unsupport `foo! bar { ... }` macros in the parser Their support in expansion was removed in https://github.com/rust-lang/rust/pull/61606. Also un-reserve `macro_rules` as a macro name, there's no ambiguity between `macro_rules` definitions and macro calls (it also wasn't reserved correctly). cc https://github.com/rust-lang-nursery/wg-grammar/issues/51
2019-07-03Remove needless lifetimesJeremy Stucki-1/+1
2019-07-01syntax: Unsupport `foo! bar { ... }` macros in the parserVadim Petrochenkov-4/+1
Unreserve `macro_rules` as a macro name
2019-06-18syntax: Factor out common fields from `SyntaxExtension` variantsVadim Petrochenkov-15/+7
2019-06-10syntax: Rename variants of `SyntaxExtension` for consistencyVadim Petrochenkov-4/+4
2019-06-10syntax: Remove `SyntaxExtension::DeclMacro`Vadim Petrochenkov-24/+7
It's a less powerful duplicate of `SyntaxExtension::NormalTT`
2019-06-10syntax: Remove `SyntaxExtension::IdentTT` and `IdentMacroExpander`Vadim Petrochenkov-4/+1
2019-05-21Move `edition` outside the hygiene lock and avoid accessing itJohn Kåre Alsaker-2/+1
2019-05-13Remove the equality operation between `Symbol` and strings.Nicholas Nethercote-2/+2
And also the equality between `Path` and strings, because `Path` is made up of `Symbol`s.
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-2/+2
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-1/+1
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-11Use `Rc<[Symbol]>` instead of `Vec<Symbol>` to reduce # of allocsOliver Scherer-1/+1
2019-02-11Rename the `exp` field to mirror its usesOliver Scherer-2/+2
2019-02-11Require a list of features to allow in `allow_internal_unstable`Oliver Scherer-3/+3
2019-02-10rustc: doc commentsAlexander Regueiro-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07Unsupport `#[derive(Trait)]` sugar for `#[derive_Trait]` legacy plugin ↵Vadim Petrochenkov-16/+0
attributes
2018-08-31Add deprecated_name argument to the register lint group functionsflip1995-3/+10
2018-08-28Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.Eduard-Mihai Burtescu-3/+3
2018-06-27Implement `#[macro_export(local_inner_macros)]`Vadim Petrochenkov-0/+3
2018-05-17Pass crate editions to macro expansions, update testsVadim Petrochenkov-2/+6
2018-05-05Misc tweaksJohn Kåre Alsaker-2/+0
2018-03-07check stability of macro invocationsAustin Bonander-2/+5
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-2/+2
Like #43008 (f668999), but _much more aggressive_.
2017-08-12syntax: #[allow_internal_unsafe] bypasses the unsafe_code lint in macros.Eduard-Mihai Burtescu-4/+18
2017-05-13Support #[allow] etc logic on a per macro levelest31-1/+2
This commit extends the current unused macro linter to support directives like #[allow(unused_macros)] or #[deny(unused_macros)] directly next to the macro definition, or in one of the modules the macro is inside. Before, we only supported such directives at a per crate level, due to the crate's NodeId being passed to session.add_lint. We also had to implement handling of the macro's NodeId in the lint visitor.
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.
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-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-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-25Implement RFC#1559: allow all literals in attributes.Sergio Benitez-3/+2
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-1/+1
2016-05-10fix Registry::args for plugins loaded with --extra-pluginsOliver Schneider-2/+5