aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy.py
diff options
context:
space:
mode:
authorJaydeep <jd.ramani111@gmail.com>2015-09-15 15:22:03 -0700
committerJaydeep <jd.ramani111@gmail.com>2015-09-26 19:33:29 -0700
commit2a999151889d32d72be658a7c75405fe33d56dc2 (patch)
treedeceab071339db2e297c20ef9c5d6d5cd7ebcb67 /python/tidy.py
parent37ce248f316ba3cb5a2cfb0b4bb95918c1c45828 (diff)
downloadservo-2a999151889d32d72be658a7c75405fe33d56dc2.tar.gz
servo-2a999151889d32d72be658a7c75405fe33d56dc2.zip
Check for Extra pointer dereferencing. Issue #7640.
Diffstat (limited to 'python/tidy.py')
-rw-r--r--python/tidy.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/tidy.py b/python/tidy.py
index eed16f41f15..93b30e147f9 100644
--- a/python/tidy.py
+++ b/python/tidy.py
@@ -111,6 +111,7 @@ def check_by_line(file_name, contents):
check_whitespace(idx, line),
check_whatwg_url(idx, line),
)
+
for error in errors:
yield error
@@ -349,6 +350,10 @@ def check_rust(file_name, contents):
yield (idx + 1 - len(mods) + i, message + expected + found)
mods = []
+ # There should not be any extra pointer dereferencing
+ if re.search(r": &Vec<", line) is not None:
+ yield (idx + 1, "use &[T] instead of &Vec<T>")
+
# Avoid flagging <Item=Foo> constructs
def is_associated_type(match, line, index):