aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/plugins/lints.rs6
-rw-r--r--components/plugins/utils.rs4
-rw-r--r--components/script/dom/browsercontext.rs2
-rw-r--r--components/script/dom/cssstyledeclaration.rs8
-rw-r--r--components/script/dom/node.rs1
5 files changed, 8 insertions, 13 deletions
diff --git a/components/plugins/lints.rs b/components/plugins/lints.rs
index 587eae0fa10..639520974e0 100644
--- a/components/plugins/lints.rs
+++ b/components/plugins/lints.rs
@@ -277,7 +277,7 @@ impl LintPass for InheritancePass {
if match_lang_ty(cx, &*f.node.ty, "reflector") {
if ctr > 0 {
cx.span_lint(INHERITANCE_INTEGRITY, f.span,
- "The Reflector should be the first field of the DOM struct");
+ "The Reflector should be the first field of the DOM struct");
}
return true;
}
@@ -287,7 +287,7 @@ impl LintPass for InheritancePass {
// Find all #[dom_struct] fields
let dom_spans: Vec<_> = def.fields.iter().enumerate().filter_map(|(ctr, f)| {
if let ast::TyPath(_, _, ty_id) = f.node.ty.node {
- if let Some(def::DefTy(def_id, _)) = cx.tcx.def_map.borrow().find_copy(&ty_id) {
+ if let Some(def::DefTy(def_id, _)) = cx.tcx.def_map.borrow().get(&ty_id).cloned() {
if ty::has_attr(cx.tcx, def_id, "_dom_struct_marker") {
// If the field is not the first, it's probably
// being misused (a)
@@ -327,7 +327,7 @@ impl LintPass for InheritancePass {
}
} else if dom_spans.len() == 0 {
cx.span_lint(INHERITANCE_INTEGRITY, cx.tcx.map.expect_item(id).span,
- "This DOM struct has no reflector or parent DOM struct");
+ "This DOM struct has no reflector or parent DOM struct");
}
}
}
diff --git a/components/plugins/utils.rs b/components/plugins/utils.rs
index ec3df8a99ad..34d74a4001f 100644
--- a/components/plugins/utils.rs
+++ b/components/plugins/utils.rs
@@ -39,7 +39,7 @@ pub fn match_ty_unwrap<'a>(ty: &'a Ty, segments: &[&str]) -> Option<&'a [P<Ty>]>
pub fn match_lang_ty(cx: &Context, ty: &Ty, value: &str) -> bool {
let mut found = false;
if let TyPath(_, _, ty_id) = ty.node {
- if let Some(def::DefTy(def_id, _)) = cx.tcx.def_map.borrow().find_copy(&ty_id) {
+ if let Some(def::DefTy(def_id, _)) = cx.tcx.def_map.borrow().get(&ty_id).cloned() {
// Iterating through attributes is hard because of cross-crate defs
ty::each_attr(cx.tcx, def_id, |attr| {
if let ast::MetaNameValue(ref name, ref val) = attr.node.value.node {
@@ -59,4 +59,4 @@ pub fn match_lang_ty(cx: &Context, ty: &Ty, value: &str) -> bool {
};
}
found
-} \ No newline at end of file
+}
diff --git a/components/script/dom/browsercontext.rs b/components/script/dom/browsercontext.rs
index 3ee2387b4f6..0bd96b75ec8 100644
--- a/components/script/dom/browsercontext.rs
+++ b/components/script/dom/browsercontext.rs
@@ -65,6 +65,8 @@ impl BrowserContext {
}
}
+// This isn't a DOM struct, just a convenience struct
+// without a reflector, so we don't mark this as #[dom_struct]
#[must_root]
#[privatize]
#[jstraceable]
diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs
index 7d4feeb40ab..8eab5fcb06e 100644
--- a/components/script/dom/cssstyledeclaration.rs
+++ b/components/script/dom/cssstyledeclaration.rs
@@ -7,7 +7,7 @@ use dom::bindings::codegen::InheritTypes::{NodeCast, ElementCast};
use dom::bindings::error::ErrorResult;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, JSRef, OptionalRootedRootable, Temporary};
-use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
+use dom::bindings::utils::{Reflector, reflect_dom_object};
use dom::document::DocumentHelpers;
use dom::element::{Element, ElementHelpers, StylePriority};
use dom::htmlelement::HTMLElement;
@@ -412,9 +412,3 @@ impl<'a> CSSStyleDeclarationMethods for JSRef<'a, CSSStyleDeclaration> {
[ZIndex, SetZIndex, "z-index"]
)
}
-
-impl Reflectable for CSSStyleDeclaration {
- fn reflector<'a>(&'a self) -> &'a Reflector {
- &self.reflector_
- }
-}
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 0b66cc678a5..a6564d801ee 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -27,7 +27,6 @@ use dom::bindings::js::{JS, JSRef, RootedReference, Temporary, Root};
use dom::bindings::js::{OptionalSettable, TemporaryPushable, OptionalRootedRootable};
use dom::bindings::js::{ResultRootable, OptionalRootable, MutNullableJS};
use dom::bindings::trace::JSTraceable;
-use dom::bindings::utils;
use dom::bindings::utils::{Reflectable, reflect_dom_object};
use dom::characterdata::CharacterData;
use dom::comment::Comment;