mirror of
https://github.com/servo/servo.git
synced 2025-06-29 03:23:41 +01:00
Unwrap pointers and miscellany for unrooted_must_root check
This commit is contained in:
parent
bded5c3703
commit
d241826987
3 changed files with 9 additions and 0 deletions
|
@ -62,6 +62,12 @@ impl LintPass for TransmutePass {
|
|||
}
|
||||
|
||||
fn lint_unrooted_ty(cx: &Context, ty: &ast::Ty, warning: &str) {
|
||||
let ty = match ty.node {
|
||||
ast::TyBox(ref t) | ast::TyUniq(ref t) |
|
||||
ast::TyVec(ref t) | ast::TyFixedLengthVec(ref t, _) |
|
||||
ast::TyPtr(ast::MutTy { ty: ref t, ..}) | ast::TyRptr(_, ast::MutTy { ty: ref t, ..}) => &**t,
|
||||
_ => ty
|
||||
};
|
||||
match ty.node {
|
||||
ast::TyPath(_, _, id) => {
|
||||
match cx.tcx.def_map.borrow().get_copy(&id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue