about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-02-10 11:15:52 +0000
committerbors <bors@rust-lang.org>2015-02-10 11:15:52 +0000
commit94c06a1be0ccfcf1a8e105fc98d126de372dbd40 (patch)
tree34c42bfdc779516ea7be5d116b31ed1bf3507ef8 /src/libsyntax
parentde8bc44753881aacdaf435f5ba61de3c20916761 (diff)
parent1aedc45f85fe9feb70971f9d0c743c4af550a080 (diff)
downloadrust-94c06a1be0ccfcf1a8e105fc98d126de372dbd40.tar.gz
rust-94c06a1be0ccfcf1a8e105fc98d126de372dbd40.zip
Auto merge of #22026 - kmcallister:plugin, r=sfackler
```rust
#[plugin] #[no_link] extern crate bleh;
```

becomes a crate attribute

```rust
#![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]
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/feature_gate.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index c8ab46ff8fd..72bbe1adfaa 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -284,11 +284,7 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
         }
         match i.node {
             ast::ItemExternCrate(_) => {
-                if attr::contains_name(&i.attrs[], "plugin") {
-                    self.gate_feature("plugin", i.span,
-                                      "compiler plugins are experimental \
-                                       and possibly buggy");
-                } else if attr::contains_name(&i.attrs[], "macro_reexport") {
+                if attr::contains_name(&i.attrs[], "macro_reexport") {
                     self.gate_feature("macro_reexport", i.span,
                                       "macros reexports are experimental \
                                        and possibly buggy");
@@ -462,6 +458,10 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
         if attr.check_name("staged_api") {
             self.gate_feature("staged_api", attr.span,
                               "staged_api is for use by rustc only");
+        } else if attr.check_name("plugin") {
+            self.gate_feature("plugin", attr.span,
+                              "compiler plugins are experimental \
+                               and possibly buggy");
         }
 
         if attr::contains_name(slice::ref_slice(attr), "lang") {