about summary refs log tree commit diff
path: root/src/librustc/metadata/creader.rs
diff options
context:
space:
mode:
authorKeegan McAllister <kmcallister@mozilla.com>2015-02-06 13:56:38 -0800
committerKeegan McAllister <kmcallister@mozilla.com>2015-02-09 13:27:27 -0800
commit93b642d9743edea728ef08b2d6fd17229caaad43 (patch)
treeb88ec4e6fac283b95735e7c34dac6760e53a2874 /src/librustc/metadata/creader.rs
parent0ba9e1fa52627404a1e5b90f745f96a872a0c564 (diff)
downloadrust-93b642d9743edea728ef08b2d6fd17229caaad43.tar.gz
rust-93b642d9743edea728ef08b2d6fd17229caaad43.zip
Use a crate attribute to load plugins
    #[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]
Diffstat (limited to 'src/librustc/metadata/creader.rs')
-rw-r--r--src/librustc/metadata/creader.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs
index d28b3afec79..f6cd0e5add2 100644
--- a/src/librustc/metadata/creader.rs
+++ b/src/librustc/metadata/creader.rs
@@ -26,7 +26,7 @@ use syntax::ast;
 use syntax::abi;
 use syntax::attr;
 use syntax::attr::AttrMetaMethods;
-use syntax::codemap::{COMMAND_LINE_SP, Span, mk_sp};
+use syntax::codemap::{Span, mk_sp};
 use syntax::parse;
 use syntax::parse::token::InternedString;
 use syntax::parse::token;
@@ -457,13 +457,13 @@ impl<'a> CrateReader<'a> {
             CrateOrString::Krate(c) => {
                 (self.extract_crate_info(c).unwrap(), c.span)
             }
-            CrateOrString::Str(s) => {
+            CrateOrString::Str(sp, s) => {
                 (CrateInfo {
                      name: s.to_string(),
                      ident: s.to_string(),
                      id: ast::DUMMY_NODE_ID,
                      should_link: true,
-                 }, COMMAND_LINE_SP)
+                 }, sp)
             }
         };
         let target_triple = &self.sess.opts.target_triple[];
@@ -531,7 +531,7 @@ impl<'a> CrateReader<'a> {
 #[derive(Copy)]
 pub enum CrateOrString<'a> {
     Krate(&'a ast::Item),
-    Str(&'a str)
+    Str(Span, &'a str)
 }
 
 impl<'a> PluginMetadata<'a> {