Skip to content

Commit 95729dc

Browse files
committed
check_missing_items.py: Don't overwrite ty in loop
Because python doesn't have lexical scope, loop variables persist after the loop is exited, set to the value of the last itteration ``` >>> i = 0 >>> for i in range(10): pass ... >>> i 9 ``` This causes the `ty` variable to be changed, causing unexpected crashes on ``` pub type RefFn<'a> = &'a dyn for<'b> Fn(&'a i32) -> i32; ```
1 parent 1202bba commit 95729dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/etc/check_missing_items.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ def check_type(ty):
8888
for bound in binding["binding"]["constraint"]:
8989
check_generic_bound(bound)
9090
elif "parenthesized" in args:
91-
for ty in args["parenthesized"]["inputs"]:
92-
check_type(ty)
91+
for input_ty in args["parenthesized"]["inputs"]:
92+
check_type(input_ty)
9393
if args["parenthesized"]["output"]:
9494
check_type(args["parenthesized"]["output"])
9595
if not valid_id(ty["inner"]["id"]):

0 commit comments

Comments
 (0)