aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2018-11-01 23:43:08 +0100
committerSimon Sapin <simon.sapin@exyr.org>2018-11-06 15:26:02 +0100
commit86f148fb97601413c0d983f21b760d973ade7a75 (patch)
tree050e1c3335ba01aa7ad27d8aff68ddcfa3267afd
parentacabd50f037837c2dc75233988690e0184cd511c (diff)
downloadservo-86f148fb97601413c0d983f21b760d973ade7a75.tar.gz
servo-86f148fb97601413c0d983f21b760d973ade7a75.zip
Use 2018-style paths in code generated by proc-macro derives
-rw-r--r--components/dom_struct/lib.rs2
-rw-r--r--components/domobject_derive/lib.rs16
-rw-r--r--components/jstraceable_derive/lib.rs8
3 files changed, 13 insertions, 13 deletions
diff --git a/components/dom_struct/lib.rs b/components/dom_struct/lib.rs
index 442aa6cf2cd..9c971665eed 100644
--- a/components/dom_struct/lib.rs
+++ b/components/dom_struct/lib.rs
@@ -47,7 +47,7 @@ pub fn dom_struct(args: TokenStream, input: TokenStream) -> TokenStream {
quote! (
#s2
- impl ::dom::bindings::inheritance::HasParent for #name {
+ impl crate::dom::bindings::inheritance::HasParent for #name {
type Parent = #ty;
/// This is used in a type assertion to ensure that
/// the source and webidls agree as to what the parent type is
diff --git a/components/domobject_derive/lib.rs b/components/domobject_derive/lib.rs
index 7eff765b928..9bd2e4bf1a4 100644
--- a/components/domobject_derive/lib.rs
+++ b/components/domobject_derive/lib.rs
@@ -41,22 +41,22 @@ fn expand_dom_object(input: syn::DeriveInput) -> quote::Tokens {
impl #impl_generics ::js::conversions::ToJSValConvertible for #name #ty_generics #where_clause {
#[allow(unsafe_code)]
unsafe fn to_jsval(&self,
- cx: *mut ::js::jsapi::JSContext,
- rval: ::js::rust::MutableHandleValue) {
- let object = ::dom::bindings::reflector::DomObject::reflector(self).get_jsobject();
+ cx: *mut js::jsapi::JSContext,
+ rval: js::rust::MutableHandleValue) {
+ let object = crate::dom::bindings::reflector::DomObject::reflector(self).get_jsobject();
object.to_jsval(cx, rval)
}
}
- impl #impl_generics ::dom::bindings::reflector::DomObject for #name #ty_generics #where_clause {
+ impl #impl_generics crate::dom::bindings::reflector::DomObject for #name #ty_generics #where_clause {
#[inline]
- fn reflector(&self) -> &::dom::bindings::reflector::Reflector {
+ fn reflector(&self) -> &crate::dom::bindings::reflector::Reflector {
self.#first_field_name.reflector()
}
}
- impl #impl_generics ::dom::bindings::reflector::MutDomObject for #name #ty_generics #where_clause {
- fn init_reflector(&mut self, obj: *mut ::js::jsapi::JSObject) {
+ impl #impl_generics crate::dom::bindings::reflector::MutDomObject for #name #ty_generics #where_clause {
+ fn init_reflector(&mut self, obj: *mut js::jsapi::JSObject) {
self.#first_field_name.init_reflector(obj);
}
}
@@ -78,7 +78,7 @@ fn expand_dom_object(input: syn::DeriveInput) -> quote::Tokens {
let mut generics = input.generics.clone();
generics
.params
- .push(parse_quote!(__T: ::dom::bindings::reflector::DomObject));
+ .push(parse_quote!(__T: crate::dom::bindings::reflector::DomObject));
let (impl_generics, _, where_clause) = generics.split_for_impl();
diff --git a/components/jstraceable_derive/lib.rs b/components/jstraceable_derive/lib.rs
index ac793f4d85a..571a50b7a1e 100644
--- a/components/jstraceable_derive/lib.rs
+++ b/components/jstraceable_derive/lib.rs
@@ -21,16 +21,16 @@ fn js_traceable_derive(s: synstructure::Structure) -> quote::Tokens {
let ident = param.ident;
where_clause
.predicates
- .push(parse_quote!(#ident: ::dom::bindings::trace::JSTraceable))
+ .push(parse_quote!(#ident: crate::dom::bindings::trace::JSTraceable))
}
let tokens = quote! {
#[allow(unsafe_code)]
- unsafe impl #impl_generics ::dom::bindings::trace::JSTraceable for #name #ty_generics #where_clause {
+ unsafe impl #impl_generics crate::dom::bindings::trace::JSTraceable for #name #ty_generics #where_clause {
#[inline]
#[allow(unused_variables, unused_imports)]
- unsafe fn trace(&self, tracer: *mut ::js::jsapi::JSTracer) {
- use ::dom::bindings::trace::JSTraceable;
+ unsafe fn trace(&self, tracer: *mut js::jsapi::JSTracer) {
+ use crate::dom::bindings::trace::JSTraceable;
match *self {
#match_body
}