mirror of
https://github.com/servo/servo.git
synced 2025-07-29 02:00:23 +01:00
Added compiler lint ban on DOMRefCell
This commit is contained in:
parent
25c6c29a27
commit
444eddb4a1
4 changed files with 29 additions and 0 deletions
|
@ -37,5 +37,11 @@ impl EarlyLintPass for BanPass {
|
|||
.is_some() {
|
||||
cx.span_lint(BANNED_TYPE, ty.span, "Banned type Cell<JSVal> detected. Use MutHeap<JSVal> instead")
|
||||
}
|
||||
if match_ty_unwrap(ty, &["dom", "bindings", "cell", "DOMRefCell"])
|
||||
.and_then(|t| t.get(0))
|
||||
.and_then(|t| match_ty_unwrap(&**t, &["dom", "bindings", "js", "JS"]))
|
||||
.is_some() {
|
||||
cx.span_lint(BANNED_TYPE, ty.span, "Banned type DOMRefCell<JS<T>> detected. Use MutHeap<JS<T>> instead")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue