aboutsummaryrefslogtreecommitdiffstats
path: root/components/macros/lib.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2014-09-16 23:31:40 +0530
committerManish Goregaokar <manishsmail@gmail.com>2014-09-16 23:31:40 +0530
commitd241826987a1f701452eb95fc50603d5aba8c890 (patch)
tree2d33fc92a81a804bd096172a8cd67daf548d8500 /components/macros/lib.rs
parentbded5c370344c5ed77b706c36e0caf911fbe4e3d (diff)
downloadservo-d241826987a1f701452eb95fc50603d5aba8c890.tar.gz
servo-d241826987a1f701452eb95fc50603d5aba8c890.zip
Unwrap pointers and miscellany for unrooted_must_root check
Diffstat (limited to 'components/macros/lib.rs')
-rw-r--r--components/macros/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/macros/lib.rs b/components/macros/lib.rs
index 5b9aa64a52d..c2af641f165 100644
--- a/components/macros/lib.rs
+++ b/components/macros/lib.rs
@@ -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) {