Skip to content

Commit bc6da11

Browse files
committed
Fix type of Closure::arg_types
1 parent a33c770 commit bc6da11

5 files changed

Lines changed: 13 additions & 11 deletions

File tree

rust/.generated.list

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/extractor/src/generated/top.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ pub struct Closure {
334334
pub id: TrapId,
335335
pub location: Option<trap::Label>,
336336
pub args: Vec<trap::Label>,
337-
pub arg_types: Vec<trap::Label>,
337+
pub arg_types: Vec<Option<trap::Label>>,
338338
pub ret_type: Option<trap::Label>,
339339
pub body: trap::Label,
340340
pub is_move: bool,
@@ -354,7 +354,9 @@ impl TrapEntry for Closure {
354354
out.add_tuple("closure_args", vec![trap::Arg::Label(id), i.into(), v.into()]);
355355
}
356356
for (i, &v) in self.arg_types.iter().enumerate() {
357-
out.add_tuple("closure_arg_types", vec![trap::Arg::Label(id), i.into(), v.into()]);
357+
if let Some(vv) = v {
358+
out.add_tuple("closure_arg_types", vec![trap::Arg::Label(id), i.into(), v.into()]);
359+
}
358360
}
359361
if let Some(v) = self.ret_type {
360362
out.add_tuple("closure_ret_types", vec![trap::Arg::Label(id), v.into()]);

rust/ql/lib/codeql/rust/generated/Closure.qll

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/ql/lib/codeql/rust/generated/Raw.qll

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ class Index(Expr):
402402

403403
class Closure(Expr):
404404
args: list[Pat]
405-
arg_types: list[TypeRef]
405+
arg_types: list[optional[TypeRef]]
406406
ret_type: optional[TypeRef]
407407
body: Expr
408408
# TODO

0 commit comments

Comments
 (0)