aboutsummaryrefslogtreecommitdiffstats
path: root/components/plugins/lints/ban.rs
diff options
context:
space:
mode:
authorTetsuharu OHZEKI <saneyuki.snyk@gmail.com>2017-02-15 20:32:36 +0900
committerTetsuharu OHZEKI <saneyuki.snyk@gmail.com>2017-02-15 20:32:36 +0900
commite5962fda4bf552d3488f976945933cff8b77a645 (patch)
treeb898902bb5221d9b7124e9b4a941eeadcd26f566 /components/plugins/lints/ban.rs
parent9702d6920a7cf6506fa26c042eb4b9f7cd061713 (diff)
downloadservo-e5962fda4bf552d3488f976945933cff8b77a645.tar.gz
servo-e5962fda4bf552d3488f976945933cff8b77a645.zip
Ban DOMRefCell<Heap<T>> by lint plugin
Diffstat (limited to 'components/plugins/lints/ban.rs')
-rw-r--r--components/plugins/lints/ban.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/plugins/lints/ban.rs b/components/plugins/lints/ban.rs
index bd152dfe313..4a4e71c08cc 100644
--- a/components/plugins/lints/ban.rs
+++ b/components/plugins/lints/ban.rs
@@ -43,5 +43,11 @@ impl EarlyLintPass for BanPass {
.is_some() {
cx.span_lint(BANNED_TYPE, ty.span, "Banned type DOMRefCell<JS<T>> detected. Use MutJS<JS<T>> instead")
}
+ if match_ty_unwrap(ty, &["dom", "bindings", "cell", "DOMRefCell"])
+ .and_then(|t| t.get(0))
+ .and_then(|t| match_ty_unwrap(&**t, &["js", "jsapi", "Heap"]))
+ .is_some() {
+ cx.span_lint(BANNED_TYPE, ty.span, "Banned type DOMRefCell<Heap<T>> detected. Use Heap<T> directly instead")
+ }
}
}