servo: Merge #7643 - Check for Extra pointer dereferencing (from jdramani:extra_ptr_dref); r=jdm

Solves issue #7640

Source-Repo: https://github.com/servo/servo
Source-Revision: 9523283c14f417014ca6d4fa8179c873bbb8f21f
This commit is contained in:
Jaydeep
2015-09-27 08:19:30 -06:00
parent 6de558b79a
commit c2aab73f0a
5 changed files with 15 additions and 10 deletions

View File

@@ -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):