summary refs log tree commit diff
path: root/src/librustc/plugin/registry.rs
AgeCommit message (Collapse)AuthorLines
2015-09-17Change to a multi-trait approachNick Cameron-5/+13
[breaking-change] for lint authors You must now implement LateLintPass or EarlyLintPass as well as LintPass and use either register_late_lint_pass or register_early_lint_pass, rather than register_lint_pass.
2015-09-17Add an early lint pass for lints that operate on the ASTNick Cameron-1/+0
There is a minor [breaking-change] for lint authors - some functions which were previously defined on `lint::Context` have moved to a trait - `LintContext`, you may need to import that trait to avoid name resolution errors.
2015-09-01Remove the Modifier and Decorator kinds of syntax extensions.Nick Cameron-3/+1
This is a [breaking-change] for syntax extension authors. The fix is to use MultiModifier or MultiDecorator, which have the same functionality but are more flexible. Users of syntax extensions are unaffected.
2015-08-29Handle gateage of built-in attributes seperatelyJonas Schievink-5/+0
This allows marking attributes as whitelisted/crate-only independent of their feature gate status. Closes #24213
2015-05-24Auto merge of #25168 - Manishearth:register_attr, r=eddybbors-0/+20
This lets plugin authors opt attributes out of the `custom_attribute` and `unused_attribute` checks. cc @thepowersgang
2015-05-13address more review commentsManish Goregaokar-1/+1
2015-05-07address review commentsManish Goregaokar-8/+5
2015-05-07Add support for registering attributes with rustc in pluginsManish Goregaokar-0/+23
This lets plugin authors opt attributes out of the `custom_attribute` and `unused_attribute` checks.
2015-04-25Rebasing and making MulitDecorators workNick Cameron-7/+2
2015-04-25Merge branch 'syntax' of https://github.com/aochagavia/rust into mulit-decorNick Cameron-0/+7
Conflicts: src/librustc/plugin/registry.rs src/libsyntax/ext/base.rs src/libsyntax/ext/cfg_attr.rs src/libsyntax/ext/deriving/mod.rs src/libsyntax/ext/expand.rs src/libsyntax/print/pprust.rs src/test/auxiliary/macro_crate_test.rs
2015-04-08Allow plugins to register LLVM passesKeegan McAllister-0/+14
2015-03-28cleanup: Remove unused braces in use statementsRicho Healey-1/+1
2015-03-06Add #[allow_internal_unstable] to track stability for macros better.Huon Wilson-3/+8
Unstable items used in a macro expansion will now always trigger stability warnings, *unless* the unstable items are directly inside a macro marked with `#[allow_internal_unstable]`. IOW, the compiler warns unless the span of the unstable item is a subspan of the definition of a macro marked with that attribute. E.g. #[allow_internal_unstable] macro_rules! foo { ($e: expr) => {{ $e; unstable(); // no warning only_called_by_foo!(); }} } macro_rules! only_called_by_foo { () => { unstable() } // warning } foo!(unstable()) // warning The unstable inside `foo` is fine, due to the attribute. But the `unstable` inside `only_called_by_foo` is not, since that macro doesn't have the attribute, and the `unstable` passed into `foo` is also not fine since it isn't contained in the macro itself (that is, even though it is only used directly in the macro). In the process this makes the stability tracking much more precise, e.g. previously `println!("{}", unstable())` got no warning, but now it does. As such, this is a bug fix that may cause [breaking-change]s. The attribute is definitely feature gated, since it explicitly allows side-stepping the feature gating system.
2015-03-03Switched to Box::new in many places.Felix S. Klock II-1/+1
Many of the modifications putting in `Box::new` calls also include a pointer to Issue 22405, which tracks going back to `box <expr>` if possible in the future. (Still tried to use `Box<_>` where it sufficed; thus some tests still have `box_syntax` enabled, as they use a mix of `box` and `Box::new`.) Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
2015-02-09Use a crate attribute to load pluginsKeegan McAllister-5/+8
#[plugin] #[no_link] extern crate bleh; becomes a crate attribute #![plugin(bleh)] The feature gate is still required. It's almost never correct to link a plugin into the resulting library / executable, because it will bring all of libsyntax and librustc with it. However if you really want this behavior, you can get it with a separate `extern crate` item in addition to the `plugin` attribute. Fixes #21043. Fixes #20769. [breaking-change]
2015-01-31Replace uses of Decorator and ModifierAdolfo OchagavĂ­a-1/+3
2015-01-15Syntax extensions on trait and impl items.Nick Cameron-2/+2
Allows modifiers to be used on methods, associated types, etc.
2015-01-05Pass the #[plugin(...)] meta item to the registrarKeegan McAllister-0/+13
2015-01-05Replace LetSyntaxTT with MacroRulesTTKeegan McAllister-6/+15
The implementation of LetSyntaxTT was specialized to macro_rules! in various ways. This gets rid of the false generality and simplifies the code.
2014-10-29Rename fail! to panic!Steve Klabnik-1/+1
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
2014-09-19Add enum variants to the type namespaceNick Cameron-3/+3
Change to resolve and update compiler and libs for uses. [breaking-change] Enum variants are now in both the value and type namespaces. This means that if you have a variant with the same name as a type in scope in a module, you will get a name clash and thus an error. The solution is to either rename the type or the variant.
2014-09-16Fallout from renamingAaron Turon-1/+1
2014-09-10Remove BasicMacroExpander and BasicIdentMacroExpanderSteven Fackler-8/+3
The spans inside of these types were always None and never used. Pass the expander function directly instead of wrapping it in one of these types. [breaking-change]
2014-08-30Add lint groups; define built-in lint groups `bad_style` and `unused`P1start-1/+12
This adds support for lint groups to the compiler. Lint groups are a way of grouping a number of lints together under one name. For example, this also defines a default lint for naming conventions, named `bad_style`. Writing `#[allow(bad_style)]` is equivalent to writing `#[allow(non_camel_case_types, non_snake_case, non_uppercase_statics)]`. These lint groups can also be defined as a compiler plugin using the new `Registry::register_lint_group` method. This also adds two built-in lint groups, `bad_style` and `unused`. The contents of these groups can be seen by running `rustc -W help`.
2014-07-08introducing let-syntaxJohn Clements-1/+3
The let-syntax expander is different in that it doesn't apply a mark to its token trees before expansion. This is used for macro_rules, and it's because macro_rules is essentially MTWT's let-syntax. You don't want to mark before expand sees let-syntax, because there's no "after" syntax to mark again. In some sense, the cleaner approach might be to introduce a new AST node that macro_rules expands into; this would make it clearer that the expansion of a macro is distinct from the addition of a new macro binding. This should work for now, though...
2014-06-24Implement lint pluginsKeegan McAllister-0/+11
2014-06-09Document rustc::pluginKeegan McAllister-3/+18
2014-06-09Implement #[plugin_registrar]Keegan McAllister-0/+55
See RFC 22. [breaking-change]