mirror of
https://github.com/servo/servo.git
synced 2025-07-24 07:40:27 +01:00
Auto merge of #9946 - yoava333:master, r=KiChjang
Added compiler lint ban on DOMRefCell this resolves https://github.com/servo/servo/issues/9924 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9946) <!-- Reviewable:end -->
This commit is contained in:
commit
d23b7481d6
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