mirror of
https://github.com/servo/servo.git
synced 2025-07-14 02:43:42 +01:00
Ban DOMRefCell<Heap<T>> by lint plugin
This commit is contained in:
parent
9702d6920a
commit
e5962fda4b
1 changed files with 6 additions and 0 deletions
|
@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue