mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Auto merge of #7643 - jdramani:extra_ptr_dref, r=jdm
Check for Extra pointer dereferencing Solves issue #7640 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7643) <!-- Reviewable:end -->
This commit is contained in:
commit
9523283c14
5 changed files with 15 additions and 10 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue