aboutsummaryrefslogtreecommitdiffstats
path: root/components/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'components/plugins')
-rw-r--r--components/plugins/jstraceable.rs7
-rw-r--r--components/plugins/lib.rs4
2 files changed, 6 insertions, 5 deletions
diff --git a/components/plugins/jstraceable.rs b/components/plugins/jstraceable.rs
index 0ef1cecea3d..4c23a1897a5 100644
--- a/components/plugins/jstraceable.rs
+++ b/components/plugins/jstraceable.rs
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use syntax::ext::base::ExtCtxt;
+use syntax::ext::base::{Annotatable, ExtCtxt};
use syntax::codemap::Span;
use syntax::ptr::P;
use syntax::ast::{Item, MetaItem, Expr};
@@ -27,7 +27,7 @@ pub fn expand_dom_struct(cx: &mut ExtCtxt, _: Span, _: &MetaItem, item: P<Item>)
/// Provides the hook to expand `#[jstraceable]` into an implementation of `JSTraceable`
///
/// The expansion basically calls `trace()` on all of the fields of the struct/enum, erroring if they do not implement the method.
-pub fn expand_jstraceable(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, item: &Item, push: &mut FnMut(P<Item>)) {
+pub fn expand_jstraceable(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, item: Annotatable, push: &mut FnMut(Annotatable)) {
let trait_def = TraitDef {
span: span,
attributes: Vec::new(),
@@ -42,12 +42,13 @@ pub fn expand_jstraceable(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, item:
args: vec!(ty::Ptr(box ty::Literal(ty::Path::new(vec!("js","jsapi","JSTracer"))), ty::Raw(ast::MutMutable))),
ret_ty: ty::nil_ty(),
attributes: vec![quote_attr!(cx, #[inline(always)])],
+ is_unsafe: false,
combine_substructure: combine_substructure(box jstraceable_substructure)
}
],
associated_types: vec![],
};
- trait_def.expand(cx, mitem, item, push)
+ trait_def.expand(cx, mitem, &item, push)
}
// Mostly copied from syntax::ext::deriving::hash
diff --git a/components/plugins/lib.rs b/components/plugins/lib.rs
index a8bf2ad8b20..887e78689a9 100644
--- a/components/plugins/lib.rs
+++ b/components/plugins/lib.rs
@@ -23,7 +23,7 @@ extern crate tenacious;
use rustc::lint::LintPassObject;
use rustc::plugin::Registry;
-use syntax::ext::base::{Decorator, Modifier};
+use syntax::ext::base::*;
use syntax::parse::token::intern;
@@ -40,7 +40,7 @@ pub mod casing;
#[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) {
reg.register_syntax_extension(intern("dom_struct"), Modifier(box jstraceable::expand_dom_struct));
- reg.register_syntax_extension(intern("jstraceable"), Decorator(box jstraceable::expand_jstraceable));
+ reg.register_syntax_extension(intern("jstraceable"), MultiDecorator(box jstraceable::expand_jstraceable));
reg.register_syntax_extension(intern("_generate_reflector"), Decorator(box reflector::expand_reflector));
reg.register_macro("to_lower", casing::expand_lower);
reg.register_macro("to_upper", casing::expand_upper);