Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken build due to nightly refactoring. Use syntax::symbol::Symb… #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ extern crate rustc_plugin;

use rustc_plugin::Registry;
use syntax::ext::base::{MultiDecorator, MultiModifier};
use syntax::parse::token::intern;
use syntax::symbol::Symbol;
use rustc::hir::map::blocks::MaybeFnLike;

use syntax::ext::base::{ExtCtxt, Annotatable};
Expand All @@ -18,11 +18,10 @@ use syntax::ptr::P;
use syntax::ast::{Item, MetaItem};
use syntax::attr;
use syntax_ext::deriving::generic::{combine_substructure, EnumMatching, FieldInfo, MethodDef, Struct, Substructure, TraitDef, ty};
use syntax::parse::token::InternedString;

#[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) {
reg.register_syntax_extension(intern("pg_export"), MultiModifier(box expand_pg_export));
reg.register_syntax_extension(Symbol::intern("pg_export"), MultiModifier(box expand_pg_export));
}

pub fn expand_pg_export(cx: &mut ExtCtxt, span: Span, _: &MetaItem, item: Annotatable) -> Annotatable {
Expand All @@ -35,17 +34,17 @@ pub fn expand_pg_export(cx: &mut ExtCtxt, span: Span, _: &MetaItem, item: Annota
match item {
Annotatable::Item(it) => {
let mut new_it = (*it).clone();
new_it.attrs.push(attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_word_item(InternedString::new("no_mangle"))));
new_it.attrs.push(attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_word_item(Symbol::intern("no_mangle"))));
Annotatable::Item(P(new_it))
}
Annotatable::ImplItem(it) => {
let mut new_it = (*it).clone();
new_it.attrs.push(attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_word_item(InternedString::new("no_mangle"))));
new_it.attrs.push(attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_word_item(Symbol::intern("no_mangle"))));
Annotatable::ImplItem(P(new_it))
}
Annotatable::TraitItem(tt) => {
let mut new_it = (*tt).clone();
new_it.attrs.push(attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_word_item(InternedString::new("no_mangle"))));
new_it.attrs.push(attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_word_item(Symbol::intern("no_mangle"))));
Annotatable::TraitItem(P(new_it))
}
}
Expand Down