Check for Extra pointer dereferencing. Issue #7640.

This commit is contained in:
Jaydeep 2015-09-15 15:22:03 -07:00
parent 37ce248f31
commit 2a99915188
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):