Skip to content

Commit

Permalink
Ban DOMRefCell<Heap<T>> by lint plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
tetsuharuohzeki committed Feb 15, 2017
1 parent 9702d69 commit e5962fd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/plugins/lints/ban.rs
Expand Up @@ -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")
}
}
}

0 comments on commit e5962fd

Please sign in to comment.