Skip to content

Commit 6057c79

Browse files
tausbnCopilot
andcommitted
Rust: fix upgrade script and update test expectations
- Remove format_args_arg_names from upgrade delete list (table exists in both schemas with different columns) - Accept updated .expected files for schema changes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 87a0ed1 commit 6057c79

File tree

19 files changed

+272
-779
lines changed

19 files changed

+272
-779
lines changed

rust/ql/lib/upgrades/66a489863649185f4a9770f894505803059a1312/upgrade.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ meta_exprs.rel: delete
77
meta_is_unsafe.rel: delete
88
meta_paths.rel: delete
99
meta_token_trees.rel: delete
10-
format_args_arg_names.rel: delete
1110
struct_field_defaults.rel: delete
1211
variant_discriminants.rel: delete
1312
trait_aliases.rel: delete

rust/ql/test/extractor-tests/canonical_path/canonical_paths.expected

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
| lib.rs:1:1:1:18 | mod anonymous | test::anonymous |
55
| lib.rs:2:1:2:16 | mod regular | test::regular |
66
| regular.rs:1:1:2:18 | struct Struct | test::regular::Struct |
7-
| regular.rs:2:12:2:17 | fn eq | <test::regular::Struct as core::cmp::PartialEq>::eq |
8-
| regular.rs:2:12:2:17 | impl ...::Eq for Struct::<...> { ... } | <test::regular::Struct as core::cmp::Eq> |
9-
| regular.rs:2:12:2:17 | impl ...::PartialEq for Struct::<...> { ... } | <test::regular::Struct as core::cmp::PartialEq> |
107
| regular.rs:4:1:6:1 | trait Trait | test::regular::Trait |
118
| regular.rs:5:5:5:16 | fn f | <_ as test::regular::Trait>::f |
129
| regular.rs:8:1:10:1 | impl Trait for Struct { ... } | <test::regular::Struct as test::regular::Trait> |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
instances
22
| gen_attr.rs:7:5:7:20 | Attr |
33
getMeta
4-
| gen_attr.rs:7:5:7:20 | Attr | gen_attr.rs:7:7:7:19 | Meta |
4+
| gen_attr.rs:7:5:7:20 | Attr | gen_attr.rs:7:7:7:19 | TokenTreeMeta |
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
instances
2-
| gen_block_expr.rs:3:28:12:1 | { ... } | isAsync: | no | isConst: | no | isGen: | no | isMove: | no | isTry: | no | isUnsafe: | no |
3-
| gen_block_expr.rs:5:5:7:5 | { ... } | isAsync: | no | isConst: | no | isGen: | no | isMove: | no | isTry: | no | isUnsafe: | no |
4-
| gen_block_expr.rs:8:5:11:5 | 'label: { ... } | isAsync: | no | isConst: | no | isGen: | no | isMove: | no | isTry: | no | isUnsafe: | no |
2+
| gen_block_expr.rs:3:28:12:1 | { ... } | isAsync: | no | isConst: | no | isGen: | no | isMove: | no | isUnsafe: | no |
3+
| gen_block_expr.rs:5:5:7:5 | { ... } | isAsync: | no | isConst: | no | isGen: | no | isMove: | no | isUnsafe: | no |
4+
| gen_block_expr.rs:8:5:11:5 | 'label: { ... } | isAsync: | no | isConst: | no | isGen: | no | isMove: | no | isUnsafe: | no |
55
getLabel
66
| gen_block_expr.rs:8:5:11:5 | 'label: { ... } | gen_block_expr.rs:8:5:8:11 | 'label |
77
getAttr
88
getStmtList
99
| gen_block_expr.rs:3:28:12:1 | { ... } | gen_block_expr.rs:3:28:12:1 | StmtList |
1010
| gen_block_expr.rs:5:5:7:5 | { ... } | gen_block_expr.rs:5:5:7:5 | StmtList |
1111
| gen_block_expr.rs:8:5:11:5 | 'label: { ... } | gen_block_expr.rs:8:13:11:5 | StmtList |
12+
getTryBlockModifier

rust/ql/test/extractor-tests/generated/FormatArgsExpr/FormatArgsArg.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ instances
1515
| gen_format_argument.rs:7:34:7:38 | FormatArgsArg |
1616
| gen_format_argument.rs:7:41:7:45 | FormatArgsArg |
1717
| gen_format_argument.rs:7:48:7:56 | FormatArgsArg |
18+
getArgName
19+
| gen_format_args_expr.rs:7:35:7:37 | FormatArgsArg | gen_format_args_expr.rs:7:35:7:36 | FormatArgsArgName |
20+
| gen_format_args_expr.rs:7:40:7:42 | FormatArgsArg | gen_format_args_expr.rs:7:40:7:41 | FormatArgsArgName |
1821
getExpr
1922
| gen_format.rs:5:26:5:32 | FormatArgsArg | gen_format.rs:5:26:5:32 | "world" |
2023
| gen_format.rs:12:35:12:38 | FormatArgsArg | gen_format.rs:12:35:12:38 | name |
@@ -32,6 +35,3 @@ getExpr
3235
| gen_format_argument.rs:7:34:7:38 | FormatArgsArg | gen_format_argument.rs:7:34:7:38 | value |
3336
| gen_format_argument.rs:7:41:7:45 | FormatArgsArg | gen_format_argument.rs:7:41:7:45 | width |
3437
| gen_format_argument.rs:7:48:7:56 | FormatArgsArg | gen_format_argument.rs:7:48:7:56 | precision |
35-
getName
36-
| gen_format_args_expr.rs:7:35:7:37 | FormatArgsArg | gen_format_args_expr.rs:7:35:7:35 | a |
37-
| gen_format_args_expr.rs:7:40:7:42 | FormatArgsArg | gen_format_args_expr.rs:7:40:7:40 | b |
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
instances
22
| gen_macro_items.rs:5:5:5:12 | MacroItems |
3-
| gen_macro_items.rs:13:12:13:14 | MacroItems |
43
getItem
54
| gen_macro_items.rs:5:5:5:12 | MacroItems | 0 | gen_macro_items.rs:5:5:5:38 | use ...::Path |
65
| gen_macro_items.rs:5:5:5:12 | MacroItems | 1 | gen_macro_items.rs:5:5:5:38 | fn get_parent |
7-
| gen_macro_items.rs:13:12:13:14 | MacroItems | 0 | gen_macro_items.rs:13:12:13:14 | impl ...::Debug for Bar::<...> { ... } |

rust/ql/test/extractor-tests/generated/StructField/StructField.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
instances
22
| gen_struct_field.rs:7:16:7:21 | x: i32 | isUnsafe: | no |
33
getAttr
4-
getDefault
4+
getDefaultVal
55
getName
66
| gen_struct_field.rs:7:16:7:21 | x: i32 | gen_struct_field.rs:7:16:7:16 | x |
77
getTypeRepr

rust/ql/test/extractor-tests/generated/Variant/Variant.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ instances
33
| gen_variant.rs:7:17:7:22 | B |
44
| gen_variant.rs:7:25:7:36 | C |
55
getAttr
6-
getDiscriminant
6+
getConstArg
77
getFieldList
88
| gen_variant.rs:7:17:7:22 | B | gen_variant.rs:7:18:7:22 | TupleFieldList |
99
| gen_variant.rs:7:25:7:36 | C | gen_variant.rs:7:27:7:36 | StructFieldList |

rust/ql/test/extractor-tests/macro-expansion/PrintAst.expected

Lines changed: 18 additions & 215 deletions
Large diffs are not rendered by default.

rust/ql/test/extractor-tests/macro-expansion/test.expected

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,20 @@ attribute_macros
1515
| macro_expansion.rs:31:5:34:5 | (item with attribute macro expansion) | 1 | macro_expansion.rs:32:5:34:5 | fn bzz_1 |
1616
| macro_expansion.rs:31:5:34:5 | (item with attribute macro expansion) | 2 | macro_expansion.rs:32:5:34:5 | fn bzz_2 |
1717
derive_macros
18-
| macro_expansion.rs:83:1:86:1 | struct MyDerive | 0 | 0 | macro_expansion.rs:84:8:85:9 | impl ...::Debug for MyDerive::<...> { ... } |
19-
| macro_expansion.rs:88:1:92:1 | enum MyDeriveEnum | 0 | 0 | macro_expansion.rs:89:6:91:12 | impl ...::PartialEq for MyDeriveEnum::<...> { ... } |
20-
| macro_expansion.rs:88:1:92:1 | enum MyDeriveEnum | 1 | 0 | macro_expansion.rs:89:6:89:17 | impl ...::Eq for MyDeriveEnum::<...> { ... } |
2118
| macro_expansion.rs:98:1:102:1 | union MyDeriveUnion | 0 | 0 | macro_expansion.rs:99:7:99:19 | Const |
2219
| macro_expansion.rs:98:1:102:1 | union MyDeriveUnion | 0 | 1 | macro_expansion.rs:99:7:99:19 | impl MyTrait for MyDeriveUnion { ... } |
2320
macro_calls
2421
| macro_expansion.rs:5:9:5:35 | concat!... | macro_expansion.rs:5:17:5:34 | "Hello world!" |
2522
| macro_expansion.rs:5:9:5:35 | concat!... | macro_expansion.rs:5:17:5:34 | "Hello world!" |
26-
| macro_expansion.rs:31:5:31:16 | ...::format_args_nl!... | macro_expansion.rs:31:5:31:16 | FormatArgsExpr |
27-
| macro_expansion.rs:31:5:31:16 | ...::format_args_nl!... | macro_expansion.rs:31:5:31:16 | FormatArgsExpr |
28-
| macro_expansion.rs:31:5:31:16 | ...::format_args_nl!... | macro_expansion.rs:31:5:31:16 | FormatArgsExpr |
29-
| macro_expansion.rs:31:5:31:16 | println!... | macro_expansion.rs:31:5:31:16 | { ... } |
30-
| macro_expansion.rs:31:5:31:16 | println!... | macro_expansion.rs:31:5:31:16 | { ... } |
31-
| macro_expansion.rs:31:5:31:16 | println!... | macro_expansion.rs:31:5:31:16 | { ... } |
32-
| macro_expansion.rs:33:9:33:16 | hello!... | macro_expansion.rs:31:5:31:16 | { ... } |
33-
| macro_expansion.rs:33:9:33:16 | hello!... | macro_expansion.rs:31:5:31:16 | { ... } |
34-
| macro_expansion.rs:33:9:33:16 | hello!... | macro_expansion.rs:31:5:31:16 | { ... } |
23+
| macro_expansion.rs:31:7:31:15 | ...::format_args_nl!... | macro_expansion.rs:31:7:31:15 | FormatArgsExpr |
24+
| macro_expansion.rs:31:7:31:15 | ...::format_args_nl!... | macro_expansion.rs:31:7:31:15 | FormatArgsExpr |
25+
| macro_expansion.rs:31:7:31:15 | ...::format_args_nl!... | macro_expansion.rs:31:7:31:15 | FormatArgsExpr |
26+
| macro_expansion.rs:31:7:31:15 | println!... | macro_expansion.rs:31:7:31:15 | { ... } |
27+
| macro_expansion.rs:31:7:31:15 | println!... | macro_expansion.rs:31:7:31:15 | { ... } |
28+
| macro_expansion.rs:31:7:31:15 | println!... | macro_expansion.rs:31:7:31:15 | { ... } |
29+
| macro_expansion.rs:33:9:33:16 | hello!... | macro_expansion.rs:31:7:31:15 | { ... } |
30+
| macro_expansion.rs:33:9:33:16 | hello!... | macro_expansion.rs:31:7:31:15 | { ... } |
31+
| macro_expansion.rs:33:9:33:16 | hello!... | macro_expansion.rs:31:7:31:15 | { ... } |
3532
| macro_expansion.rs:44:5:44:13 | def_x!... | macro_expansion.rs:44:5:44:10 | MacroItems |
3633
| macro_expansion.rs:53:9:53:25 | concat!... | macro_expansion.rs:53:17:53:24 | "xy" |
3734
| macro_expansion.rs:55:9:58:5 | my_macro!... | macro_expansion.rs:56:9:57:13 | MacroExpr |

0 commit comments

Comments
 (0)