From bafef791f78ab95d4a6397273f6f1db5ad5cd68d Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Mon, 30 Sep 2024 10:24:41 +0200 Subject: [PATCH 1/2] Rust: Add extraction error consistency query --- rust/ql/consistency-queries/ExtractionConsistency.ql | 3 +++ .../ExprStmt/CONSISTENCY/ExtractionConsistency.expected | 1 + .../IfExpr/CONSISTENCY/ExtractionConsistency.expected | 1 + .../PrefixExpr/CONSISTENCY/ExtractionConsistency.expected | 3 +++ .../utf8/CONSISTENCY/ExtractionConsistency.expected | 4 ++++ .../controlflow/CONSISTENCY/ExtractionConsistency.expected | 7 +++++++ .../diagnostics/CONSISTENCY/ExtractionConsistency.expected | 6 ++++++ 7 files changed, 25 insertions(+) create mode 100644 rust/ql/consistency-queries/ExtractionConsistency.ql create mode 100644 rust/ql/test/extractor-tests/generated/ExprStmt/CONSISTENCY/ExtractionConsistency.expected create mode 100644 rust/ql/test/extractor-tests/generated/IfExpr/CONSISTENCY/ExtractionConsistency.expected create mode 100644 rust/ql/test/extractor-tests/generated/PrefixExpr/CONSISTENCY/ExtractionConsistency.expected create mode 100644 rust/ql/test/extractor-tests/utf8/CONSISTENCY/ExtractionConsistency.expected create mode 100644 rust/ql/test/library-tests/controlflow/CONSISTENCY/ExtractionConsistency.expected create mode 100644 rust/ql/test/query-tests/diagnostics/CONSISTENCY/ExtractionConsistency.expected diff --git a/rust/ql/consistency-queries/ExtractionConsistency.ql b/rust/ql/consistency-queries/ExtractionConsistency.ql new file mode 100644 index 000000000000..b839f2ad783c --- /dev/null +++ b/rust/ql/consistency-queries/ExtractionConsistency.ql @@ -0,0 +1,3 @@ +import codeql.rust.Diagnostics + +query predicate extractionError(ExtractionError ee) { any() } diff --git a/rust/ql/test/extractor-tests/generated/ExprStmt/CONSISTENCY/ExtractionConsistency.expected b/rust/ql/test/extractor-tests/generated/ExprStmt/CONSISTENCY/ExtractionConsistency.expected new file mode 100644 index 000000000000..7fddb9e7d8f0 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ExprStmt/CONSISTENCY/ExtractionConsistency.expected @@ -0,0 +1 @@ +| gen_expr_stmt.rs:6:13:6:12 | expected SEMICOLON | diff --git a/rust/ql/test/extractor-tests/generated/IfExpr/CONSISTENCY/ExtractionConsistency.expected b/rust/ql/test/extractor-tests/generated/IfExpr/CONSISTENCY/ExtractionConsistency.expected new file mode 100644 index 000000000000..bd939f1463b1 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IfExpr/CONSISTENCY/ExtractionConsistency.expected @@ -0,0 +1 @@ +| gen_if_expr.rs:12:6:12:5 | expected SEMICOLON | diff --git a/rust/ql/test/extractor-tests/generated/PrefixExpr/CONSISTENCY/ExtractionConsistency.expected b/rust/ql/test/extractor-tests/generated/PrefixExpr/CONSISTENCY/ExtractionConsistency.expected new file mode 100644 index 000000000000..31ac1b40c95d --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/PrefixExpr/CONSISTENCY/ExtractionConsistency.expected @@ -0,0 +1,3 @@ +| gen_prefix_expr.rs:5:16:5:15 | expected SEMICOLON | +| gen_prefix_expr.rs:6:18:6:17 | expected SEMICOLON | +| gen_prefix_expr.rs:7:17:7:16 | expected SEMICOLON | diff --git a/rust/ql/test/extractor-tests/utf8/CONSISTENCY/ExtractionConsistency.expected b/rust/ql/test/extractor-tests/utf8/CONSISTENCY/ExtractionConsistency.expected new file mode 100644 index 000000000000..23b423a489a1 --- /dev/null +++ b/rust/ql/test/extractor-tests/utf8/CONSISTENCY/ExtractionConsistency.expected @@ -0,0 +1,4 @@ +| lib.rs:3:9:3:8 | expected `;` or `{` | +| lib.rs:3:9:3:8 | expected an item | +| lib.rs:3:21:3:20 | expected BANG | +| lib.rs:3:21:3:20 | expected `{`, `[`, `(` | diff --git a/rust/ql/test/library-tests/controlflow/CONSISTENCY/ExtractionConsistency.expected b/rust/ql/test/library-tests/controlflow/CONSISTENCY/ExtractionConsistency.expected new file mode 100644 index 000000000000..4ae7cdb92da8 --- /dev/null +++ b/rust/ql/test/library-tests/controlflow/CONSISTENCY/ExtractionConsistency.expected @@ -0,0 +1,7 @@ +| test.rs:26:35:26:34 | expected `,` | +| test.rs:26:35:26:34 | missing type for function parameter | +| test.rs:26:37:26:36 | missing type for function parameter | +| test.rs:40:38:40:37 | expected `,` | +| test.rs:40:38:40:37 | missing type for function parameter | +| test.rs:40:40:40:39 | missing type for function parameter | +| test.rs:122:43:122:42 | expected type | diff --git a/rust/ql/test/query-tests/diagnostics/CONSISTENCY/ExtractionConsistency.expected b/rust/ql/test/query-tests/diagnostics/CONSISTENCY/ExtractionConsistency.expected new file mode 100644 index 000000000000..157aafc87852 --- /dev/null +++ b/rust/ql/test/query-tests/diagnostics/CONSISTENCY/ExtractionConsistency.expected @@ -0,0 +1,6 @@ +| does_not_compile.rs:2:6:2:5 | expected SEMICOLON | +| does_not_compile.rs:2:9:2:8 | expected SEMICOLON | +| does_not_compile.rs:2:13:2:12 | expected SEMICOLON | +| does_not_compile.rs:2:21:2:20 | expected SEMICOLON | +| does_not_compile.rs:2:26:2:25 | expected SEMICOLON | +| does_not_compile.rs:2:32:2:31 | expected field name or number | From 3e77dd8b6b48b50e7a77e38181ede9aa9dccbdb3 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Mon, 30 Sep 2024 10:36:56 +0200 Subject: [PATCH 2/2] Rust: Fix extraction errors --- rust/ql/.generated.list | 18 +- rust/ql/lib/codeql/rust/elements/ExprStmt.qll | 2 +- rust/ql/lib/codeql/rust/elements/IfExpr.qll | 2 +- .../lib/codeql/rust/elements/PrefixExpr.qll | 6 +- .../rust/elements/internal/ExprStmtImpl.qll | 2 +- .../rust/elements/internal/IfExprImpl.qll | 2 +- .../rust/elements/internal/PrefixExprImpl.qll | 6 +- .../elements/internal/generated/ExprStmt.qll | 2 +- .../elements/internal/generated/IfExpr.qll | 2 +- .../internal/generated/PrefixExpr.qll | 6 +- .../rust/elements/internal/generated/Raw.qll | 10 +- .../generated/.generated_tests.list | 6 +- .../ExtractionConsistency.expected | 1 - .../generated/ExprStmt/ExprStmt.expected | 2 +- .../ExprStmt/ExprStmt_getExpr.expected | 2 +- .../generated/ExprStmt/gen_expr_stmt.rs | 2 +- .../ExtractionConsistency.expected | 1 - .../generated/IfExpr/gen_if_expr.rs | 2 +- .../ExtractionConsistency.expected | 3 - .../generated/PrefixExpr/gen_prefix_expr.rs | 6 +- .../CONSISTENCY/CfgConsistency.expected | 4 +- .../ExtractionConsistency.expected | 7 - .../library-tests/controlflow/Cfg.expected | 206 +++++++++--------- .../ql/test/library-tests/controlflow/test.rs | 21 +- rust/schema/annotations.py | 10 +- 25 files changed, 159 insertions(+), 172 deletions(-) delete mode 100644 rust/ql/test/extractor-tests/generated/ExprStmt/CONSISTENCY/ExtractionConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/IfExpr/CONSISTENCY/ExtractionConsistency.expected delete mode 100644 rust/ql/test/extractor-tests/generated/PrefixExpr/CONSISTENCY/ExtractionConsistency.expected delete mode 100644 rust/ql/test/library-tests/controlflow/CONSISTENCY/ExtractionConsistency.expected diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index 84ae527f3008..bc4fb9f23bb0 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -27,7 +27,7 @@ lib/codeql/rust/elements/DynTraitType.qll 5d249ac6b61916dad08be29631de77405928f0 lib/codeql/rust/elements/Element.qll 0b62d139fef54ed2cf2e2334806aa9bfbc036c9c2085d558f15a42cc3fa84c48 24b999b93df79383ef27ede46e38da752868c88a07fe35fcff5d526684ba7294 lib/codeql/rust/elements/Enum.qll 2f122b042519d55e221fceac72fce24b30d4caf1947b25e9b68ee4a2095deb11 83a47445145e4fda8c3631db602a42dbb7a431f259eddf5c09dccd86f6abdd0e lib/codeql/rust/elements/Expr.qll e5d65e805ccf440d64d331e55df4c4144ab8c8f63f367382494714087659ffe8 2bbc1e5d3a65f413ec33d9822fa451fbdbe32349158db58cc0bfcfafb0e21bda -lib/codeql/rust/elements/ExprStmt.qll ea950ac5cbe8d8004bd674b5aeaf1f0b33d5b5910a41f2d4bca07f8ea36d1066 d882208b17fd3d2c8da07b1b84cb40d4c15938dc67c3d8404e36de57da84428c +lib/codeql/rust/elements/ExprStmt.qll 00ac4c7d0192b9e8b0f28d5ae59c27729ff5a831ca11938ea3e677a262337a64 7cc02aa5346cd7c50d75ca63cd6501097b0a3979eb2ed838adff114fe17d35a3 lib/codeql/rust/elements/ExternBlock.qll 23d7ca86ad0366cfb0c5300a6e205f1fe59eebcb1b18dd5b6ea7fdba3830ca68 c718eed50d4d55b67e9cfcebee018b8e6f9b783f2b2f0e21c5785ead0f11f5b6 lib/codeql/rust/elements/ExternCrate.qll 54e93a9ec560d72dc0f0269b42b237f21abbf37023492e657f048764d70b0734 fc5bb6f255f5293fd4f56cd14d5ce0ae781abff28c1f984101c38e15f82405df lib/codeql/rust/elements/ExternItem.qll c39bbae40fa569d3d84a10045d7eeced3db85e6cb7147f7a7065c5b484f890a1 bc56d6db3d05dbc552927d004328fbe399960711c920ef6b47f6faaa1a541183 @@ -45,7 +45,7 @@ lib/codeql/rust/elements/GenericArgList.qll dcf274db517b0e8f19e4545d77f86cdd4066 lib/codeql/rust/elements/GenericParam.qll b58448b808d6dfa05db9574f54c22ce51f0b1d78784263c75a95d6bfc787067d 4afbab71fe717d7d7d3e2f60ea8c3d97bcb29b17b4efb79eabfe8f070edcb9bb lib/codeql/rust/elements/GenericParamList.qll 91d6f8cab06d7a3c53cfc714698a04c867867536705f03ed37b135e9e87f78c8 d1d88c31f712ca7ea83b6bf61466710069f2fbdfa40499321686e2867b99b35f lib/codeql/rust/elements/IdentPat.qll ad5f202316d4eeee3ca81ea445728f4ad7eb6bb7d81232bc958c22a93d064bf2 7ce2772e391e593d8fd23b2b44e26d0d7e780327ec973fcc9dce52a75fda0e36 -lib/codeql/rust/elements/IfExpr.qll 277cda4e962ec19a70bef282945de9064d1652e788901d4d0b15c6e228663c36 6fd342afbbbc6335e23aa9d179c14ef5dacfe7d14420f3a75655cf6d1030183e +lib/codeql/rust/elements/IfExpr.qll f62153e8098b3eb08b569d4e25c750bc686665651579db4bc9e11dcef8e75d63 55006a55d612f189e73caa02f7b4deda388c692f0a801cdda9f833f2afdca778 lib/codeql/rust/elements/Impl.qll 9593c47af4fa08afb19c52aab7d0bac6740fed7ec60201f47e7bc46f13bfb329 4ec840401563ab6136b99491b881c9a10108240de972b19ec64227e1e7d73e65 lib/codeql/rust/elements/ImplTraitType.qll f7241044f6666a509cfbc01bf6df3db5360e67dd0f9baba4a323566701359203 350636d0b1c7a77e006170cbfa9108c259dd5831b0f242da76c10be3ecc32870 lib/codeql/rust/elements/IndexExpr.qll 0e2e9f018d06ae72be0fc4ddbc019a9aacd8a06f42b4c4431760bd149e7f2290 2bcfd557abd53a48e48de7915c4f2089107c62dfb3e732a904848248dfd3727b @@ -93,7 +93,7 @@ lib/codeql/rust/elements/PathExpr.qll 99aa8af9deb9e276eb262b1fbd1a19f1c816cafac6 lib/codeql/rust/elements/PathPat.qll 6897e69bcb24b56d39ede796cf5767988dcd5741e02333fa8495dd7c814f771a 2a011fb92f17e4b4ff713e6d29f591054dfede22a9aaa006e67fca2c23ab76bf lib/codeql/rust/elements/PathSegment.qll 536a8fe172db367e5f1dc678a014e2350eadfc379242d2b5451725e826ab1448 1a3a237f56c1d9ccdce6832ec6417fed25cd3e29ba836363cc6085e2125de4c5 lib/codeql/rust/elements/PathType.qll a7bd3b05dc2c0e96c91c5485db508a1f5bb8fe3a01486be6815ae9dabb163add b11e996b6c0cc21a3d8d1ddc23c37e4d54a78e84a9278b3ceca1e94cb7321532 -lib/codeql/rust/elements/PrefixExpr.qll 63975ca70b011ce5fbe67338493f21e7da45e1c6c508c76b122dcdfc557fb72a b3863e8722774edfff4c0cffc2bcc8235055f1ef68cf164bc0fb9316d3a8ed2a +lib/codeql/rust/elements/PrefixExpr.qll 107e7bd111b637fd6d76026062d54c2780760b965f172ef119c50dd0714a377d 46954a9404e561c51682395729daac3bda5442113f29839d043e9605d63f7f6d lib/codeql/rust/elements/PtrType.qll b137f47a53e41b3b30c7d80dbdd6724bf15f99530ca40cc264a04af5f07aa878 b2ffdf739bfb7564d942fe54409834a59511c0b305b6d5b2219a8ee0ef594332 lib/codeql/rust/elements/RangeExpr.qll 43785bea08a6a537010db1138e68ae92eed7e481744188dfb3bad119425ff740 5e81cfbdf4617372a73d662a248a0b380c1f40988a5daefb7f00057cae10d3d4 lib/codeql/rust/elements/RangePat.qll b5c0cfc84b8a767d58593fa7102dcf4be3ff8b02ba2f5360c384fa8af4aac830 cc28399dd99630bfa50c54e641a3833abe6643137d010a0a25749d1d70e8c911 @@ -206,7 +206,7 @@ lib/codeql/rust/elements/internal/EnumConstructor.qll eca1a13937faacb1db50e4cf69 lib/codeql/rust/elements/internal/EnumImpl.qll c4dfa97b0c656957390417ab09c81b29b67fbff1b7b14976d65625ebea6b2c11 940303d4d4cec130f1981d309f8eaea6803c14a41174bbe9a87dd12ce4975945 lib/codeql/rust/elements/internal/ExprImpl.qll ab20ee174e2e786f34af6e5dedf3ec071bb89fc266b3e91df6377f72aa38d3f2 f68192700f449bf1c229cfbaabd5353c7c559941c915d5a0c88752cf9844194b lib/codeql/rust/elements/internal/ExprStmtConstructor.qll dd6bb06a7d48c12f630aafd611621cc50ce0f3e7d9abba5484a695f90879264b dc8b6ec8acc314e041ae71868803630c5d4cab488c72c1ea929bb756e1847c52 -lib/codeql/rust/elements/internal/ExprStmtImpl.qll b6791b2152812597f2147d7bab1835e6e96ccb6eb2dacb124aaf4a53dee54d83 bae6bfd615ee551c926df3654b9d235bf3428abe1ab479e5b08da6c8188a9075 +lib/codeql/rust/elements/internal/ExprStmtImpl.qll 420221c64245b490dab85f4e50d6b408cf488349869eb87312c166e185ad8145 2c2a4c71eea8c1ad8823e8e22780fadebb38ae502b3a7b9b062923a188fef692 lib/codeql/rust/elements/internal/ExternBlockConstructor.qll 884bafd1cb5a6ce9f54a7a6b9ba1c8814f38e3baf69a2ff8cfc8b02163204b9d ee26e070fcbfd730bbfaf0502d5ed54110c25f84e7b65948c8638a314b67ea5d lib/codeql/rust/elements/internal/ExternBlockImpl.qll 6c7e89b5e9113d014b6835e86c4653d4b34e05d565ab0264c0593aac463389a4 f0f06a8657bac7e5e5e8edaf0dfe83a6c3e323aed2e112e3df6f882306732c5f lib/codeql/rust/elements/internal/ExternCrateConstructor.qll edd4d69ca7e36bd8389a96eac4ce04d9dd3857b0470b9f24319312469b0f8654 c80f4968e675f4b29e92a2fd8783f800823cc855ad193fee64869d5ba244d949 @@ -237,7 +237,7 @@ lib/codeql/rust/elements/internal/GenericParamListImpl.qll 524aa0949df6d4d2cb9be lib/codeql/rust/elements/internal/IdentPatConstructor.qll 09792f5a070996b65f095dc6b1b9e0fb096a56648eed26c0643c59f82377cab0 0bb1a9fcdc62b5197aef3dd6e0ea4d679dde10d5be54b57b5209727ba66e078b lib/codeql/rust/elements/internal/IdentPatImpl.qll 10b2758419b48d34013d0e1ea55006a72ea351e5298c9cde4d988f510d4094eb 63bdb210d7bcab42888b4f44688966a33951061573b0a9a734b5b262cbfa2cd8 lib/codeql/rust/elements/internal/IfExprConstructor.qll 03088b54c8fa623f93a5b5a7eb896f680e8b0e9025488157a02c48aaebc6ad56 906f916c3690d0721a31dd31b302dcdcec4233bb507683007d82cf10793a648f -lib/codeql/rust/elements/internal/IfExprImpl.qll 3f1496ad8622e83aeffc9269e8f3d1dfd5da1672e98bcd98cd2e67ead659fee3 9cd037ff01af557be51f792e36d5f1b62c838f0f988c8bfba38124f430416345 +lib/codeql/rust/elements/internal/IfExprImpl.qll 96dc5be0a650a74f96e0c2214eb58f1af5278ad1695ad790b660fdecb6738c14 06a292fcc459297ef3a0ef5c75c887f993ccd6350eb3fb0d2493e5b7c7199b6b lib/codeql/rust/elements/internal/ImplConstructor.qll 24edccca59f70d812d1458b412a45310ddc096d095332f6e3258903c54c1bb44 7eb673b3ab33a0873ee5ce189105425066b376821cce0fc9eb8ace22995f0bc7 lib/codeql/rust/elements/internal/ImplImpl.qll 33a57be871fe3ab08467a65f2e2e9fb7df9f096c98e9f86d8a755eaf6da6e446 f01d0e9bfccf3926ae9720d3d660ba97e1c094f318bfb252449b2d387176f6a9 lib/codeql/rust/elements/internal/ImplTraitTypeConstructor.qll b47501280b026a4e9c21ace21d9ae59f4d126a3a1e03a6088ca38cd676cc4f6d 3b0b325ab0139b290a81355559227050ba3096a58f9ff01c4c0f5c5fb5beb6ee @@ -471,7 +471,7 @@ lib/codeql/rust/elements/internal/generated/DynTraitType.qll da9dce6347ce385d746 lib/codeql/rust/elements/internal/generated/Element.qll fb483b636180c699181c8aff83bc471b2c416206694f7028c671015918547663 542d1b9ae80c997974c94db3655887186df3921a8fa3f565eaf292dcfdac3c4c lib/codeql/rust/elements/internal/generated/Enum.qll 4f4cbc9cd758c20d476bc767b916c62ba434d1750067d0ffb63e0821bb95ec86 3da735d54022add50cec0217bbf8ec4cf29b47f4851ee327628bcdd6454989d0 lib/codeql/rust/elements/internal/generated/Expr.qll 5fa34f2ed21829a1509417440dae42d416234ff43433002974328e7aabb8f30f 46f3972c7413b7db28a3ea8acb5a50a74b6dd9b658e8725f6953a8829ac912f8 -lib/codeql/rust/elements/internal/generated/ExprStmt.qll a5947ce40426114df440bc910d2f0117e2a084e8c8bf32ac9a77a4ad68acc119 bc5077b764146db27ddada71a6f1dd10c092322bad05febc3b64798aa24c5360 +lib/codeql/rust/elements/internal/generated/ExprStmt.qll d1112230015fbeb216b43407a268dc2ccd0f9e0836ab2dca4800c51b38fa1d7d 4a80562dcc55efa5e72c6c3b1d6747ab44fe494e76faff2b8f6e9f10a4b08b5b lib/codeql/rust/elements/internal/generated/ExternBlock.qll a8ba7dec266603ef1e3908f923a497bd1e206ec729cfd4ad397ef4502fddc745 cc20b5a47466dab52a8d57c1b3c99b09c01420967670c2e75d3f90302ced2dbb lib/codeql/rust/elements/internal/generated/ExternCrate.qll 35fea4e810a896c1656adb4682c4c3bc20283768073e26ae064189ce310433c8 fc504dff79ba758d89b10cd5049539fbc766ee9862ff495066cea26abf0b5e0b lib/codeql/rust/elements/internal/generated/ExternItem.qll 749b064ad60f32197d5b85e25929afe18e56e12f567b73e21e43e2fdf4c447e3 e2c2d423876675cf2dae399ca442aef7b2860319da9bfadeff29f2c6946f8de7 @@ -489,7 +489,7 @@ lib/codeql/rust/elements/internal/generated/GenericArgList.qll b8cd936bba6f28344 lib/codeql/rust/elements/internal/generated/GenericParam.qll a0285123f974f287154b706bf6688b86edf72a4adcec57346c654d962435651b b42c3915e9564b5b5c5282229bf882aa3309de26a77721b2255d6f4235c0cc38 lib/codeql/rust/elements/internal/generated/GenericParamList.qll f2d8945bc70cda6929bb6b652f9e3c7707e73fb5e778b21e99dbac594e71285f 7b97da5b6a6504377456bedebddc293d714f90e8fc2ce64199656666d5f749af lib/codeql/rust/elements/internal/generated/IdentPat.qll 557b2b1fe9e719ac6658c06c162f03d5925d848d7fdc4364da850e588a3ca9df 5517fde679c47c0604a0d177c53bed64f83e33e14d1b64f45e3467e3a8be77fb -lib/codeql/rust/elements/internal/generated/IfExpr.qll 3d3655fae99a338559f538c245346730ac8cc615ed39e809e7140d217ba3353f 0a58f73b8007980238a039841edaedfcd40368fcf3b1d90d890d2ef405545c45 +lib/codeql/rust/elements/internal/generated/IfExpr.qll 413dd7a20c6b98c0d2ad2e5b50981c14bf96c1a719ace3e341d78926219a5af7 c9a2d44e3baa6a265a29a683ca3c1683352457987c92f599c5771b4f3b4bafff lib/codeql/rust/elements/internal/generated/Impl.qll 31fdd707dd8dcec845758b19eddcd4eb5bbd44ddccac83191cebe0c402834a66 ef06985099dee900a9403898f45349619ed138d23fee185137ed0baf679fe7cc lib/codeql/rust/elements/internal/generated/ImplTraitType.qll 3c29684f5ef386b883b79dc9758441d97f090e065be177ffc8240aaf0f3d1e7b 03ea42c2a95cf917ec73d88b7b4ca5e53e10d7b046074f59100c0ec6c2c1ed6d lib/codeql/rust/elements/internal/generated/IndexExpr.qll cf951fc40f6690e966b4dc78fa9a6221aa5c6cade44759dcb52254f799292d11 1572e71918cc4e0b7e028331b6d98c9db23100a3646cd3874d1915e06ab6211d @@ -538,12 +538,12 @@ lib/codeql/rust/elements/internal/generated/PathExpr.qll 17cdb0a7393258a207450f0 lib/codeql/rust/elements/internal/generated/PathPat.qll 98c9938d6a359fd717829b196eb09701d2c798e18c1f43fa7b2a9145afdf6c19 caba2e629cae08682baac90a76ae9a48cda2d7d6f9c23d506fa0ff3f292978a4 lib/codeql/rust/elements/internal/generated/PathSegment.qll 4621597fd86246f788b8f9ca73f6b0f27929fc04261ce3ccf85da1183071431d aadda8bce386a3b7a9c53b98465eedcc4f724e37b8a904c1775af5b7ffb041ee lib/codeql/rust/elements/internal/generated/PathType.qll 45de78e5374d6eb0446e2112ec72d3692c2811df9fa2ad03d0127e426940abe3 622cf70408413a565a0dac58f451035ac1339c8d0ee5b24f630680201cb0aa48 -lib/codeql/rust/elements/internal/generated/PrefixExpr.qll d723079487d2f648121721dd5e43436e95efd9b0876eee39c0d5e044269718d3 20e5fed17709435245d946e9e0dae51a29d879e66c5dfc21c3140f801cde47ac +lib/codeql/rust/elements/internal/generated/PrefixExpr.qll c9ede5f2deb7b41bc8240969e8554f645057018fe96e7e9ad9c2924c8b14722b 5ae2e3c3dc8fa73e7026ef6534185afa6b0b5051804435d8b741dd3640c864e1 lib/codeql/rust/elements/internal/generated/PtrType.qll 5f12b6ad29b4e5ce51c205e2199594ce190e1aa24fbe3ddcfd82317a0b472222 8940e8dcccdf5cfc863aa2f2bc52bbddfa4d9ac8e8b38973cc1ecc1fbe32b3d4 lib/codeql/rust/elements/internal/generated/PureSynthConstructors.qll dc03515d678ba052c2ff2dd9f0883e0bce54cac740ba9a15e5173f292c1b6971 dc03515d678ba052c2ff2dd9f0883e0bce54cac740ba9a15e5173f292c1b6971 lib/codeql/rust/elements/internal/generated/RangeExpr.qll 23cca03bf43535f33b22a38894f70d669787be4e4f5b8fe5c8f7b964d30e9027 18624cef6c6b679eeace2a98737e472432e0ead354cca02192b4d45330f047c9 lib/codeql/rust/elements/internal/generated/RangePat.qll efd93730de217cf50dcba5875595263a5eadf9f7e4e1272401342a094d158614 229b251b3d118932e31e78ac4dfb75f48b766f240f20d436062785606d44467b -lib/codeql/rust/elements/internal/generated/Raw.qll e99568e4adeb158ca514e886c7c2193583932c5f685d1d2ea75e9d544b5a60b1 957270b1cd461050fdec2eb6249d216cfc4f3fe34efe2be147b0e2a6f1e43ece +lib/codeql/rust/elements/internal/generated/Raw.qll 2a2939bffd64f073912aec93dfe7e26b35aeaa4746bc21ffbf21575bab71f9b1 6ac30484d43ee941e7789626ad6c115aff91f5088c49afbb4dce01dcac45a7f8 lib/codeql/rust/elements/internal/generated/RecordExpr.qll eb6cb662e463f9260efae1a6ce874fa781172063b916ef1963f861e9942d308d 1a21cbccc8f3799ff13281e822818ebfb21d81591720a427cac3625512cb9d40 lib/codeql/rust/elements/internal/generated/RecordExprField.qll 7e9f8663d3b74ebbc9603b10c9912f082febba6bd73d344b100bbd3edf837802 fbe6b578e7fd5d5a6f21bbb8c388957ab7210a6a249ec71510a50fb35b319ea1 lib/codeql/rust/elements/internal/generated/RecordExprFieldList.qll 179a97211fe7aa6265085d4d54115cdbc0e1cd7c9b2135591e8f36d6432f13d3 dd44bbbc1e83a1ed3a587afb729d7debf7aeb7b63245de181726af13090e50c0 diff --git a/rust/ql/lib/codeql/rust/elements/ExprStmt.qll b/rust/ql/lib/codeql/rust/elements/ExprStmt.qll index ba07a0d02a00..79511bf6c0df 100644 --- a/rust/ql/lib/codeql/rust/elements/ExprStmt.qll +++ b/rust/ql/lib/codeql/rust/elements/ExprStmt.qll @@ -11,7 +11,7 @@ import codeql.rust.elements.Stmt * An expression statement. For example: * ```rust * start(); - * finish() + * finish(); * use std::env; * ``` */ diff --git a/rust/ql/lib/codeql/rust/elements/IfExpr.qll b/rust/ql/lib/codeql/rust/elements/IfExpr.qll index 4cc9cde31c70..d3689b9957a8 100644 --- a/rust/ql/lib/codeql/rust/elements/IfExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/IfExpr.qll @@ -20,7 +20,7 @@ import codeql.rust.elements.Expr * 1 * } else { * 0 - * } + * }; * ``` */ final class IfExpr = Impl::IfExpr; diff --git a/rust/ql/lib/codeql/rust/elements/PrefixExpr.qll b/rust/ql/lib/codeql/rust/elements/PrefixExpr.qll index a90e69c4c818..8bc627a39e7d 100644 --- a/rust/ql/lib/codeql/rust/elements/PrefixExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/PrefixExpr.qll @@ -10,9 +10,9 @@ import codeql.rust.elements.Expr /** * A unary operation expression. For example: * ```rust - * let x = -42 - * let y = !true - * let z = *ptr + * let x = -42; + * let y = !true; + * let z = *ptr; * ``` */ final class PrefixExpr = Impl::PrefixExpr; diff --git a/rust/ql/lib/codeql/rust/elements/internal/ExprStmtImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/ExprStmtImpl.qll index 73806be519b8..1f36bd00db7e 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/ExprStmtImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/ExprStmtImpl.qll @@ -16,7 +16,7 @@ module Impl { * An expression statement. For example: * ```rust * start(); - * finish() + * finish(); * use std::env; * ``` */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/IfExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/IfExprImpl.qll index a500d39c298e..f9aec6faed35 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/IfExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/IfExprImpl.qll @@ -24,7 +24,7 @@ module Impl { * 1 * } else { * 0 - * } + * }; * ``` */ class IfExpr extends Generated::IfExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/internal/PrefixExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/PrefixExprImpl.qll index 51df8a764454..56fd5914660e 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/PrefixExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/PrefixExprImpl.qll @@ -15,9 +15,9 @@ module Impl { /** * A unary operation expression. For example: * ```rust - * let x = -42 - * let y = !true - * let z = *ptr + * let x = -42; + * let y = !true; + * let z = *ptr; * ``` */ class PrefixExpr extends Generated::PrefixExpr { diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/ExprStmt.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/ExprStmt.qll index 796630f83d03..23396d0c9042 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/ExprStmt.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/ExprStmt.qll @@ -18,7 +18,7 @@ module Generated { * An expression statement. For example: * ```rust * start(); - * finish() + * finish(); * use std::env; * ``` * INTERNAL: Do not reference the `Generated::ExprStmt` class directly. diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/IfExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/IfExpr.qll index 386c74d25f9f..57d726b6210e 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/IfExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/IfExpr.qll @@ -28,7 +28,7 @@ module Generated { * 1 * } else { * 0 - * } + * }; * ``` * INTERNAL: Do not reference the `Generated::IfExpr` class directly. * Use the subclass `IfExpr`, where the following predicates are available. diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/PrefixExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/PrefixExpr.qll index 307572a27c89..d8c4bc290515 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/PrefixExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/PrefixExpr.qll @@ -18,9 +18,9 @@ module Generated { /** * A unary operation expression. For example: * ```rust - * let x = -42 - * let y = !true - * let z = *ptr + * let x = -42; + * let y = !true; + * let z = *ptr; * ``` * INTERNAL: Do not reference the `Generated::PrefixExpr` class directly. * Use the subclass `PrefixExpr`, where the following predicates are available. diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll index 4340f391a447..fe559ef3fb2d 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll @@ -1597,7 +1597,7 @@ module Raw { * An expression statement. For example: * ```rust * start(); - * finish() + * finish(); * use std::env; * ``` */ @@ -1793,7 +1793,7 @@ module Raw { * 1 * } else { * 0 - * } + * }; * ``` */ class IfExpr extends @if_expr, Expr { @@ -2378,9 +2378,9 @@ module Raw { * INTERNAL: Do not use. * A unary operation expression. For example: * ```rust - * let x = -42 - * let y = !true - * let z = *ptr + * let x = -42; + * let y = !true; + * let z = *ptr; * ``` */ class PrefixExpr extends @prefix_expr, Expr { diff --git a/rust/ql/test/extractor-tests/generated/.generated_tests.list b/rust/ql/test/extractor-tests/generated/.generated_tests.list index 0a3f2946e480..92acb5f72d33 100644 --- a/rust/ql/test/extractor-tests/generated/.generated_tests.list +++ b/rust/ql/test/extractor-tests/generated/.generated_tests.list @@ -23,7 +23,7 @@ ConstParam/gen_const_param.rs f0a4176333b9519b4cc2533a083f68f6859b5b0855d1b0dbce ContinueExpr/gen_continue_expr.rs 63840dcd8440aaf1b96b713b80eb2b56acb1639d3200b3c732b45291a071b5ff 63840dcd8440aaf1b96b713b80eb2b56acb1639d3200b3c732b45291a071b5ff DynTraitType/gen_dyn_trait_type.rs 65b8e54bdc4bdfff8b68480582acca642bf2d28e316c5251fb3b8371cd7328bd 65b8e54bdc4bdfff8b68480582acca642bf2d28e316c5251fb3b8371cd7328bd Enum/gen_enum.rs efa816c579bfba60d1f32f818b022956d08d397af508c82b7331f14615f25be4 efa816c579bfba60d1f32f818b022956d08d397af508c82b7331f14615f25be4 -ExprStmt/gen_expr_stmt.rs 318a0fd72ee8d6da17c5d635ba0724ed2c11c0f7e9b75c939990cd0c7f3929e4 318a0fd72ee8d6da17c5d635ba0724ed2c11c0f7e9b75c939990cd0c7f3929e4 +ExprStmt/gen_expr_stmt.rs 6ce47428a8d33b902c1f14b06cc375d08eff95251e4a81dac2fa51872b7649b1 6ce47428a8d33b902c1f14b06cc375d08eff95251e4a81dac2fa51872b7649b1 ExternBlock/gen_extern_block.rs 5b5c4d7a2c4a91027df1578b74900ae1b971aede7720ab12de9bb918c42a583d 5b5c4d7a2c4a91027df1578b74900ae1b971aede7720ab12de9bb918c42a583d ExternCrate/gen_extern_crate.rs 9b3ab23a56b7778723ce436b25310547b2b0aeca3e5c6b7e61f273b5ce5573e3 9b3ab23a56b7778723ce436b25310547b2b0aeca3e5c6b7e61f273b5ce5573e3 ExternItemList/gen_extern_item_list.rs ff2baaaa32099808b86fbf6f4853171146594d5db23c6ee447eb5cec10cee7cf ff2baaaa32099808b86fbf6f4853171146594d5db23c6ee447eb5cec10cee7cf @@ -37,7 +37,7 @@ Function/gen_function.rs ba6ecb9e0d89183295eb02f3c20ebbf5c209f89bd0172c73a3b4a6d GenericArgList/gen_generic_arg_list.rs cfb072d3b48f9dd568c23d4dfefba28766628678f66bbf9a436de9919ead35f5 cfb072d3b48f9dd568c23d4dfefba28766628678f66bbf9a436de9919ead35f5 GenericParamList/gen_generic_param_list.rs 4cc9b628f53e1a6c5781ad195b8648fa6dee0bb41b24007fbd986527374d3669 4cc9b628f53e1a6c5781ad195b8648fa6dee0bb41b24007fbd986527374d3669 IdentPat/gen_ident_pat.rs 87f9201ca47683ff6f12a0c844c062fdedb6d86546794522d358b117ba0fe477 87f9201ca47683ff6f12a0c844c062fdedb6d86546794522d358b117ba0fe477 -IfExpr/gen_if_expr.rs f2f79d4df0f01dc691b5c62c0f9e1815d7ebc978cf83b7559b5eeab0fcc2fc01 f2f79d4df0f01dc691b5c62c0f9e1815d7ebc978cf83b7559b5eeab0fcc2fc01 +IfExpr/gen_if_expr.rs 2df66735394ebb20db29d3fbf2721ad4812afbe8d4614d03f26265c1f481f1e8 2df66735394ebb20db29d3fbf2721ad4812afbe8d4614d03f26265c1f481f1e8 Impl/gen_impl.rs dd97fa44ec844b735b30e7dfd1b8ecd4449c7914af1ea427edcba848194a84ed dd97fa44ec844b735b30e7dfd1b8ecd4449c7914af1ea427edcba848194a84ed ImplTraitType/gen_impl_trait_type.rs feef13242cbee4e8c59a6db01778384d6d27d5b702431c2fd8dca0859f04a831 feef13242cbee4e8c59a6db01778384d6d27d5b702431c2fd8dca0859f04a831 IndexExpr/gen_index_expr.rs 22d7f81ba43dc63f1f49e21a2c25ce25a1b8f6e8e95e1a66f518f010a4d73c61 22d7f81ba43dc63f1f49e21a2c25ce25a1b8f6e8e95e1a66f518f010a4d73c61 @@ -81,7 +81,7 @@ PathExpr/gen_path_expr.rs a1e0ececfe62a63a43583c9bd8064a80a90c042c55bac29d86776c PathPat/gen_path_pat.rs fd7f941f8b33f19d3693be1fdb595c2fb2e85e8296702b82bf12bcd44632f371 fd7f941f8b33f19d3693be1fdb595c2fb2e85e8296702b82bf12bcd44632f371 PathSegment/gen_path_segment.rs bc0c914821a70f9a7db23766f4d84e2d69fc76d5075a8bc3341f2ba59a8ce911 bc0c914821a70f9a7db23766f4d84e2d69fc76d5075a8bc3341f2ba59a8ce911 PathType/gen_path_type.rs 710a5505615769da940202e7c6d9031edc23a4b05cd9fb25241c60affbba4027 710a5505615769da940202e7c6d9031edc23a4b05cd9fb25241c60affbba4027 -PrefixExpr/gen_prefix_expr.rs 2b7c6eb7efe5b1bbf895dde386eca9e1c4dcfa047ca141628580c97ec304ac4a 2b7c6eb7efe5b1bbf895dde386eca9e1c4dcfa047ca141628580c97ec304ac4a +PrefixExpr/gen_prefix_expr.rs c4b53e87f370713b9a9e257be26d082b0761497bac19b1d7401a31b22b30d1ab c4b53e87f370713b9a9e257be26d082b0761497bac19b1d7401a31b22b30d1ab PtrType/gen_ptr_type.rs dd7faad19454b92d7942ef664df1a5f26c01863e408b87249aa4d5d4f68c78b3 dd7faad19454b92d7942ef664df1a5f26c01863e408b87249aa4d5d4f68c78b3 RangeExpr/gen_range_expr.rs 3f27cff9cc76b2703beff622d1453b84121e1970a869e45f9428deac92c4ecb0 3f27cff9cc76b2703beff622d1453b84121e1970a869e45f9428deac92c4ecb0 RangePat/gen_range_pat.rs 18b5169c3ab9230c95d86c4897f8343b2176d9602c9ea371c70c1eb0dbf89a28 18b5169c3ab9230c95d86c4897f8343b2176d9602c9ea371c70c1eb0dbf89a28 diff --git a/rust/ql/test/extractor-tests/generated/ExprStmt/CONSISTENCY/ExtractionConsistency.expected b/rust/ql/test/extractor-tests/generated/ExprStmt/CONSISTENCY/ExtractionConsistency.expected deleted file mode 100644 index 7fddb9e7d8f0..000000000000 --- a/rust/ql/test/extractor-tests/generated/ExprStmt/CONSISTENCY/ExtractionConsistency.expected +++ /dev/null @@ -1 +0,0 @@ -| gen_expr_stmt.rs:6:13:6:12 | expected SEMICOLON | diff --git a/rust/ql/test/extractor-tests/generated/ExprStmt/ExprStmt.expected b/rust/ql/test/extractor-tests/generated/ExprStmt/ExprStmt.expected index 96760932ea05..61f85c10f9e6 100644 --- a/rust/ql/test/extractor-tests/generated/ExprStmt/ExprStmt.expected +++ b/rust/ql/test/extractor-tests/generated/ExprStmt/ExprStmt.expected @@ -1,2 +1,2 @@ | gen_expr_stmt.rs:5:5:5:12 | ExprStmt | hasExpr: | yes | -| gen_expr_stmt.rs:6:5:6:12 | ExprStmt | hasExpr: | yes | +| gen_expr_stmt.rs:6:5:6:13 | ExprStmt | hasExpr: | yes | diff --git a/rust/ql/test/extractor-tests/generated/ExprStmt/ExprStmt_getExpr.expected b/rust/ql/test/extractor-tests/generated/ExprStmt/ExprStmt_getExpr.expected index 71219fa8ac91..f29a7f83d7d5 100644 --- a/rust/ql/test/extractor-tests/generated/ExprStmt/ExprStmt_getExpr.expected +++ b/rust/ql/test/extractor-tests/generated/ExprStmt/ExprStmt_getExpr.expected @@ -1,2 +1,2 @@ | gen_expr_stmt.rs:5:5:5:12 | ExprStmt | gen_expr_stmt.rs:5:5:5:11 | CallExpr | -| gen_expr_stmt.rs:6:5:6:12 | ExprStmt | gen_expr_stmt.rs:6:5:6:12 | CallExpr | +| gen_expr_stmt.rs:6:5:6:13 | ExprStmt | gen_expr_stmt.rs:6:5:6:12 | CallExpr | diff --git a/rust/ql/test/extractor-tests/generated/ExprStmt/gen_expr_stmt.rs b/rust/ql/test/extractor-tests/generated/ExprStmt/gen_expr_stmt.rs index bf6d4f667f27..31a3c227cc5c 100644 --- a/rust/ql/test/extractor-tests/generated/ExprStmt/gen_expr_stmt.rs +++ b/rust/ql/test/extractor-tests/generated/ExprStmt/gen_expr_stmt.rs @@ -3,6 +3,6 @@ fn test_expr_stmt() -> () { // An expression statement. For example: start(); - finish() + finish(); use std::env; } diff --git a/rust/ql/test/extractor-tests/generated/IfExpr/CONSISTENCY/ExtractionConsistency.expected b/rust/ql/test/extractor-tests/generated/IfExpr/CONSISTENCY/ExtractionConsistency.expected deleted file mode 100644 index bd939f1463b1..000000000000 --- a/rust/ql/test/extractor-tests/generated/IfExpr/CONSISTENCY/ExtractionConsistency.expected +++ /dev/null @@ -1 +0,0 @@ -| gen_if_expr.rs:12:6:12:5 | expected SEMICOLON | diff --git a/rust/ql/test/extractor-tests/generated/IfExpr/gen_if_expr.rs b/rust/ql/test/extractor-tests/generated/IfExpr/gen_if_expr.rs index 22de54eb8962..2afd9864525c 100644 --- a/rust/ql/test/extractor-tests/generated/IfExpr/gen_if_expr.rs +++ b/rust/ql/test/extractor-tests/generated/IfExpr/gen_if_expr.rs @@ -9,5 +9,5 @@ fn test_if_expr() -> () { 1 } else { 0 - } + }; } diff --git a/rust/ql/test/extractor-tests/generated/PrefixExpr/CONSISTENCY/ExtractionConsistency.expected b/rust/ql/test/extractor-tests/generated/PrefixExpr/CONSISTENCY/ExtractionConsistency.expected deleted file mode 100644 index 31ac1b40c95d..000000000000 --- a/rust/ql/test/extractor-tests/generated/PrefixExpr/CONSISTENCY/ExtractionConsistency.expected +++ /dev/null @@ -1,3 +0,0 @@ -| gen_prefix_expr.rs:5:16:5:15 | expected SEMICOLON | -| gen_prefix_expr.rs:6:18:6:17 | expected SEMICOLON | -| gen_prefix_expr.rs:7:17:7:16 | expected SEMICOLON | diff --git a/rust/ql/test/extractor-tests/generated/PrefixExpr/gen_prefix_expr.rs b/rust/ql/test/extractor-tests/generated/PrefixExpr/gen_prefix_expr.rs index b3101ca64b21..96dbb3148f64 100644 --- a/rust/ql/test/extractor-tests/generated/PrefixExpr/gen_prefix_expr.rs +++ b/rust/ql/test/extractor-tests/generated/PrefixExpr/gen_prefix_expr.rs @@ -2,7 +2,7 @@ fn test_prefix_expr() -> () { // A unary operation expression. For example: - let x = -42 - let y = !true - let z = *ptr + let x = -42; + let y = !true; + let z = *ptr; } diff --git a/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected b/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected index a457b59c6a5a..6e64220452e4 100644 --- a/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected +++ b/rust/ql/test/library-tests/controlflow/CONSISTENCY/CfgConsistency.expected @@ -1,3 +1,3 @@ deadEnd -| test.rs:124:28:124:33 | ... < ... | -| test.rs:139:30:141:9 | BlockExpr | +| test.rs:125:28:125:33 | ... < ... | +| test.rs:140:30:140:48 | BlockExpr | diff --git a/rust/ql/test/library-tests/controlflow/CONSISTENCY/ExtractionConsistency.expected b/rust/ql/test/library-tests/controlflow/CONSISTENCY/ExtractionConsistency.expected deleted file mode 100644 index 4ae7cdb92da8..000000000000 --- a/rust/ql/test/library-tests/controlflow/CONSISTENCY/ExtractionConsistency.expected +++ /dev/null @@ -1,7 +0,0 @@ -| test.rs:26:35:26:34 | expected `,` | -| test.rs:26:35:26:34 | missing type for function parameter | -| test.rs:26:37:26:36 | missing type for function parameter | -| test.rs:40:38:40:37 | expected `,` | -| test.rs:40:38:40:37 | missing type for function parameter | -| test.rs:40:40:40:39 | missing type for function parameter | -| test.rs:122:43:122:42 | expected type | diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index 428af789b1d9..70ae68e0bfcc 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -62,7 +62,7 @@ | test.rs:23:16:23:19 | true | test.rs:23:9:23:19 | ReturnExpr | | | test.rs:26:5:38:5 | enter test_break_with_labels | test.rs:27:9:36:9 | ExprStmt | | | test.rs:26:5:38:5 | exit test_break_with_labels (normal) | test.rs:26:5:38:5 | exit test_break_with_labels | | -| test.rs:26:47:38:5 | BlockExpr | test.rs:26:5:38:5 | exit test_break_with_labels (normal) | | +| test.rs:26:48:38:5 | BlockExpr | test.rs:26:5:38:5 | exit test_break_with_labels (normal) | | | test.rs:27:9:36:9 | ExprStmt | test.rs:29:17:33:17 | ExprStmt | | | test.rs:27:9:36:9 | LoopExpr | test.rs:37:9:37:12 | true | | | test.rs:27:22:36:9 | BlockExpr | test.rs:29:17:33:17 | ExprStmt | | @@ -80,7 +80,7 @@ | test.rs:32:21:32:33 | ExprStmt | test.rs:32:21:32:32 | BreakExpr | | | test.rs:34:17:34:28 | BreakExpr | test.rs:28:13:35:13 | LoopExpr | break('inner) | | test.rs:34:17:34:29 | ExprStmt | test.rs:34:17:34:28 | BreakExpr | | -| test.rs:37:9:37:12 | true | test.rs:26:47:38:5 | BlockExpr | | +| test.rs:37:9:37:12 | true | test.rs:26:48:38:5 | BlockExpr | | | test.rs:40:5:52:5 | enter test_continue_with_labels | test.rs:42:13:42:14 | ExprStmt | | | test.rs:42:13:42:13 | 1 | test.rs:44:17:48:17 | ExprStmt | | | test.rs:42:13:42:14 | ExprStmt | test.rs:42:13:42:13 | 1 | | @@ -153,117 +153,117 @@ | test.rs:85:5:91:5 | exit test_nested_if (normal) | test.rs:85:5:91:5 | exit test_nested_if | | | test.rs:85:38:91:5 | BlockExpr | test.rs:85:5:91:5 | exit test_nested_if (normal) | | | test.rs:86:9:90:9 | IfExpr | test.rs:85:38:91:5 | BlockExpr | | -| test.rs:86:12:86:48 | ParenExpr | test.rs:87:13:87:13 | 1 | true | -| test.rs:86:12:86:48 | ParenExpr | test.rs:89:13:89:13 | 0 | false | -| test.rs:86:13:86:47 | IfExpr | test.rs:86:12:86:48 | ParenExpr | | +| test.rs:86:12:86:49 | ParenExpr | test.rs:87:13:87:13 | 1 | true | +| test.rs:86:12:86:49 | ParenExpr | test.rs:89:13:89:13 | 0 | false | +| test.rs:86:13:86:48 | IfExpr | test.rs:86:12:86:49 | ParenExpr | | | test.rs:86:16:86:16 | PathExpr | test.rs:86:20:86:20 | 0 | | | test.rs:86:16:86:20 | ... < ... | test.rs:86:24:86:24 | PathExpr | true | | test.rs:86:16:86:20 | ... < ... | test.rs:86:41:86:41 | PathExpr | false | | test.rs:86:20:86:20 | 0 | test.rs:86:16:86:20 | ... < ... | | -| test.rs:86:22:86:32 | BlockExpr | test.rs:86:13:86:47 | IfExpr | | +| test.rs:86:22:86:32 | BlockExpr | test.rs:86:13:86:48 | IfExpr | | | test.rs:86:24:86:24 | PathExpr | test.rs:86:29:86:30 | 10 | | | test.rs:86:24:86:30 | ... < ... | test.rs:86:22:86:32 | BlockExpr | | | test.rs:86:28:86:30 | - ... | test.rs:86:24:86:30 | ... < ... | | | test.rs:86:29:86:30 | 10 | test.rs:86:28:86:30 | - ... | | -| test.rs:86:39:86:47 | BlockExpr | test.rs:86:13:86:47 | IfExpr | | +| test.rs:86:39:86:48 | BlockExpr | test.rs:86:13:86:48 | IfExpr | | | test.rs:86:41:86:41 | PathExpr | test.rs:86:45:86:46 | 10 | | -| test.rs:86:41:86:46 | ... > ... | test.rs:86:39:86:47 | BlockExpr | | +| test.rs:86:41:86:46 | ... > ... | test.rs:86:39:86:48 | BlockExpr | | | test.rs:86:45:86:46 | 10 | test.rs:86:41:86:46 | ... > ... | | -| test.rs:86:50:88:9 | BlockExpr | test.rs:86:9:90:9 | IfExpr | | -| test.rs:87:13:87:13 | 1 | test.rs:86:50:88:9 | BlockExpr | | +| test.rs:86:51:88:9 | BlockExpr | test.rs:86:9:90:9 | IfExpr | | +| test.rs:87:13:87:13 | 1 | test.rs:86:51:88:9 | BlockExpr | | | test.rs:88:16:90:9 | BlockExpr | test.rs:86:9:90:9 | IfExpr | | | test.rs:89:13:89:13 | 0 | test.rs:88:16:90:9 | BlockExpr | | -| test.rs:93:5:99:5 | enter test_nested_if_match | test.rs:94:19:94:19 | PathExpr | | -| test.rs:93:5:99:5 | exit test_nested_if_match (normal) | test.rs:93:5:99:5 | exit test_nested_if_match | | -| test.rs:93:44:99:5 | BlockExpr | test.rs:93:5:99:5 | exit test_nested_if_match (normal) | | -| test.rs:94:9:98:9 | IfExpr | test.rs:93:44:99:5 | BlockExpr | | -| test.rs:94:12:94:46 | ParenExpr | test.rs:95:13:95:13 | 1 | true | -| test.rs:94:12:94:46 | ParenExpr | test.rs:97:13:97:13 | 0 | false | -| test.rs:94:13:94:45 | MatchExpr | test.rs:94:12:94:46 | ParenExpr | | -| test.rs:94:19:94:19 | PathExpr | test.rs:94:23:94:23 | LiteralPat | | -| test.rs:94:23:94:23 | LiteralPat | test.rs:94:28:94:31 | true | match | -| test.rs:94:23:94:23 | LiteralPat | test.rs:94:34:94:34 | WildcardPat | no-match | -| test.rs:94:28:94:31 | true | test.rs:94:13:94:45 | MatchExpr | | -| test.rs:94:34:94:34 | WildcardPat | test.rs:94:39:94:43 | false | match | -| test.rs:94:39:94:43 | false | test.rs:94:13:94:45 | MatchExpr | | -| test.rs:94:48:96:9 | BlockExpr | test.rs:94:9:98:9 | IfExpr | | -| test.rs:95:13:95:13 | 1 | test.rs:94:48:96:9 | BlockExpr | | -| test.rs:96:16:98:9 | BlockExpr | test.rs:94:9:98:9 | IfExpr | | -| test.rs:97:13:97:13 | 0 | test.rs:96:16:98:9 | BlockExpr | | -| test.rs:105:5:108:5 | enter test_and_operator | test.rs:106:9:106:28 | LetStmt | | -| test.rs:105:5:108:5 | exit test_and_operator (normal) | test.rs:105:5:108:5 | exit test_and_operator | | -| test.rs:105:61:108:5 | BlockExpr | test.rs:105:5:108:5 | exit test_and_operator (normal) | | -| test.rs:106:9:106:28 | LetStmt | test.rs:106:17:106:27 | ... && ... | | -| test.rs:106:13:106:13 | IdentPat | test.rs:107:9:107:9 | PathExpr | match, no-match | -| test.rs:106:17:106:17 | PathExpr | test.rs:106:13:106:13 | IdentPat | false | -| test.rs:106:17:106:17 | PathExpr | test.rs:106:22:106:22 | PathExpr | true | -| test.rs:106:17:106:22 | ... && ... | test.rs:106:17:106:17 | PathExpr | | -| test.rs:106:17:106:27 | ... && ... | test.rs:106:17:106:22 | ... && ... | | -| test.rs:106:22:106:22 | PathExpr | test.rs:106:13:106:13 | IdentPat | false | -| test.rs:106:22:106:22 | PathExpr | test.rs:106:27:106:27 | PathExpr | true | -| test.rs:106:27:106:27 | PathExpr | test.rs:106:13:106:13 | IdentPat | | -| test.rs:107:9:107:9 | PathExpr | test.rs:105:61:108:5 | BlockExpr | | -| test.rs:110:5:113:5 | enter test_or_operator | test.rs:111:9:111:28 | LetStmt | | -| test.rs:110:5:113:5 | exit test_or_operator (normal) | test.rs:110:5:113:5 | exit test_or_operator | | -| test.rs:110:60:113:5 | BlockExpr | test.rs:110:5:113:5 | exit test_or_operator (normal) | | -| test.rs:111:9:111:28 | LetStmt | test.rs:111:17:111:27 | ... \|\| ... | | -| test.rs:111:13:111:13 | IdentPat | test.rs:112:9:112:9 | PathExpr | match, no-match | -| test.rs:111:17:111:17 | PathExpr | test.rs:111:13:111:13 | IdentPat | true | -| test.rs:111:17:111:17 | PathExpr | test.rs:111:22:111:22 | PathExpr | false | -| test.rs:111:17:111:22 | ... \|\| ... | test.rs:111:17:111:17 | PathExpr | | -| test.rs:111:17:111:27 | ... \|\| ... | test.rs:111:17:111:22 | ... \|\| ... | | -| test.rs:111:22:111:22 | PathExpr | test.rs:111:13:111:13 | IdentPat | true | -| test.rs:111:22:111:22 | PathExpr | test.rs:111:27:111:27 | PathExpr | false | -| test.rs:111:27:111:27 | PathExpr | test.rs:111:13:111:13 | IdentPat | | -| test.rs:112:9:112:9 | PathExpr | test.rs:110:60:113:5 | BlockExpr | | -| test.rs:115:5:118:5 | enter test_or_operator_2 | test.rs:116:9:116:36 | LetStmt | | -| test.rs:115:5:118:5 | exit test_or_operator_2 (normal) | test.rs:115:5:118:5 | exit test_or_operator_2 | | -| test.rs:115:61:118:5 | BlockExpr | test.rs:115:5:118:5 | exit test_or_operator_2 (normal) | | -| test.rs:116:9:116:36 | LetStmt | test.rs:116:17:116:35 | ... \|\| ... | | -| test.rs:116:13:116:13 | IdentPat | test.rs:117:9:117:9 | PathExpr | match, no-match | -| test.rs:116:17:116:17 | PathExpr | test.rs:116:13:116:13 | IdentPat | true | -| test.rs:116:17:116:17 | PathExpr | test.rs:116:23:116:23 | PathExpr | false | -| test.rs:116:17:116:30 | ... \|\| ... | test.rs:116:17:116:17 | PathExpr | | -| test.rs:116:17:116:35 | ... \|\| ... | test.rs:116:17:116:30 | ... \|\| ... | | -| test.rs:116:22:116:30 | ParenExpr | test.rs:116:13:116:13 | IdentPat | true | -| test.rs:116:22:116:30 | ParenExpr | test.rs:116:35:116:35 | PathExpr | false | -| test.rs:116:23:116:23 | PathExpr | test.rs:116:28:116:29 | 28 | | -| test.rs:116:23:116:29 | ... == ... | test.rs:116:22:116:30 | ParenExpr | | -| test.rs:116:28:116:29 | 28 | test.rs:116:23:116:29 | ... == ... | | -| test.rs:116:35:116:35 | PathExpr | test.rs:116:13:116:13 | IdentPat | | -| test.rs:117:9:117:9 | PathExpr | test.rs:115:61:118:5 | BlockExpr | | -| test.rs:122:1:128:1 | enter test_match | test.rs:123:11:123:21 | PathExpr | | -| test.rs:122:1:128:1 | exit test_match (normal) | test.rs:122:1:128:1 | exit test_match | | -| test.rs:122:44:128:1 | BlockExpr | test.rs:122:1:128:1 | exit test_match (normal) | | -| test.rs:123:5:127:5 | MatchExpr | test.rs:122:44:128:1 | BlockExpr | | -| test.rs:123:11:123:21 | PathExpr | test.rs:124:9:124:23 | TupleStructPat | | -| test.rs:124:9:124:23 | TupleStructPat | test.rs:124:28:124:28 | PathExpr | match | -| test.rs:124:9:124:23 | TupleStructPat | test.rs:125:9:125:23 | TupleStructPat | no-match | -| test.rs:124:28:124:28 | PathExpr | test.rs:124:32:124:33 | 10 | | -| test.rs:124:32:124:33 | 10 | test.rs:124:28:124:33 | ... < ... | | +| test.rs:93:5:102:5 | enter test_nested_if_match | test.rs:94:19:94:19 | PathExpr | | +| test.rs:93:5:102:5 | exit test_nested_if_match (normal) | test.rs:93:5:102:5 | exit test_nested_if_match | | +| test.rs:93:44:102:5 | BlockExpr | test.rs:93:5:102:5 | exit test_nested_if_match (normal) | | +| test.rs:94:9:101:9 | IfExpr | test.rs:93:44:102:5 | BlockExpr | | +| test.rs:94:12:97:10 | ParenExpr | test.rs:98:13:98:13 | 1 | true | +| test.rs:94:12:97:10 | ParenExpr | test.rs:100:13:100:13 | 0 | false | +| test.rs:94:13:97:9 | MatchExpr | test.rs:94:12:97:10 | ParenExpr | | +| test.rs:94:19:94:19 | PathExpr | test.rs:95:13:95:13 | LiteralPat | | +| test.rs:95:13:95:13 | LiteralPat | test.rs:95:18:95:21 | true | match | +| test.rs:95:13:95:13 | LiteralPat | test.rs:96:13:96:13 | WildcardPat | no-match | +| test.rs:95:18:95:21 | true | test.rs:94:13:97:9 | MatchExpr | | +| test.rs:96:13:96:13 | WildcardPat | test.rs:96:18:96:22 | false | match | +| test.rs:96:18:96:22 | false | test.rs:94:13:97:9 | MatchExpr | | +| test.rs:97:12:99:9 | BlockExpr | test.rs:94:9:101:9 | IfExpr | | +| test.rs:98:13:98:13 | 1 | test.rs:97:12:99:9 | BlockExpr | | +| test.rs:99:16:101:9 | BlockExpr | test.rs:94:9:101:9 | IfExpr | | +| test.rs:100:13:100:13 | 0 | test.rs:99:16:101:9 | BlockExpr | | +| test.rs:107:5:110:5 | enter test_and_operator | test.rs:108:9:108:28 | LetStmt | | +| test.rs:107:5:110:5 | exit test_and_operator (normal) | test.rs:107:5:110:5 | exit test_and_operator | | +| test.rs:107:61:110:5 | BlockExpr | test.rs:107:5:110:5 | exit test_and_operator (normal) | | +| test.rs:108:9:108:28 | LetStmt | test.rs:108:17:108:27 | ... && ... | | +| test.rs:108:13:108:13 | IdentPat | test.rs:109:9:109:9 | PathExpr | match, no-match | +| test.rs:108:17:108:17 | PathExpr | test.rs:108:13:108:13 | IdentPat | false | +| test.rs:108:17:108:17 | PathExpr | test.rs:108:22:108:22 | PathExpr | true | +| test.rs:108:17:108:22 | ... && ... | test.rs:108:17:108:17 | PathExpr | | +| test.rs:108:17:108:27 | ... && ... | test.rs:108:17:108:22 | ... && ... | | +| test.rs:108:22:108:22 | PathExpr | test.rs:108:13:108:13 | IdentPat | false | +| test.rs:108:22:108:22 | PathExpr | test.rs:108:27:108:27 | PathExpr | true | +| test.rs:108:27:108:27 | PathExpr | test.rs:108:13:108:13 | IdentPat | | +| test.rs:109:9:109:9 | PathExpr | test.rs:107:61:110:5 | BlockExpr | | +| test.rs:112:5:115:5 | enter test_or_operator | test.rs:113:9:113:28 | LetStmt | | +| test.rs:112:5:115:5 | exit test_or_operator (normal) | test.rs:112:5:115:5 | exit test_or_operator | | +| test.rs:112:60:115:5 | BlockExpr | test.rs:112:5:115:5 | exit test_or_operator (normal) | | +| test.rs:113:9:113:28 | LetStmt | test.rs:113:17:113:27 | ... \|\| ... | | +| test.rs:113:13:113:13 | IdentPat | test.rs:114:9:114:9 | PathExpr | match, no-match | +| test.rs:113:17:113:17 | PathExpr | test.rs:113:13:113:13 | IdentPat | true | +| test.rs:113:17:113:17 | PathExpr | test.rs:113:22:113:22 | PathExpr | false | +| test.rs:113:17:113:22 | ... \|\| ... | test.rs:113:17:113:17 | PathExpr | | +| test.rs:113:17:113:27 | ... \|\| ... | test.rs:113:17:113:22 | ... \|\| ... | | +| test.rs:113:22:113:22 | PathExpr | test.rs:113:13:113:13 | IdentPat | true | +| test.rs:113:22:113:22 | PathExpr | test.rs:113:27:113:27 | PathExpr | false | +| test.rs:113:27:113:27 | PathExpr | test.rs:113:13:113:13 | IdentPat | | +| test.rs:114:9:114:9 | PathExpr | test.rs:112:60:115:5 | BlockExpr | | +| test.rs:117:5:120:5 | enter test_or_operator_2 | test.rs:118:9:118:36 | LetStmt | | +| test.rs:117:5:120:5 | exit test_or_operator_2 (normal) | test.rs:117:5:120:5 | exit test_or_operator_2 | | +| test.rs:117:61:120:5 | BlockExpr | test.rs:117:5:120:5 | exit test_or_operator_2 (normal) | | +| test.rs:118:9:118:36 | LetStmt | test.rs:118:17:118:35 | ... \|\| ... | | +| test.rs:118:13:118:13 | IdentPat | test.rs:119:9:119:9 | PathExpr | match, no-match | +| test.rs:118:17:118:17 | PathExpr | test.rs:118:13:118:13 | IdentPat | true | +| test.rs:118:17:118:17 | PathExpr | test.rs:118:23:118:23 | PathExpr | false | +| test.rs:118:17:118:30 | ... \|\| ... | test.rs:118:17:118:17 | PathExpr | | +| test.rs:118:17:118:35 | ... \|\| ... | test.rs:118:17:118:30 | ... \|\| ... | | +| test.rs:118:22:118:30 | ParenExpr | test.rs:118:13:118:13 | IdentPat | true | +| test.rs:118:22:118:30 | ParenExpr | test.rs:118:35:118:35 | PathExpr | false | +| test.rs:118:23:118:23 | PathExpr | test.rs:118:28:118:29 | 28 | | +| test.rs:118:23:118:29 | ... == ... | test.rs:118:22:118:30 | ParenExpr | | +| test.rs:118:28:118:29 | 28 | test.rs:118:23:118:29 | ... == ... | | +| test.rs:118:35:118:35 | PathExpr | test.rs:118:13:118:13 | IdentPat | | +| test.rs:119:9:119:9 | PathExpr | test.rs:117:61:120:5 | BlockExpr | | +| test.rs:123:1:129:1 | enter test_match | test.rs:124:11:124:21 | PathExpr | | +| test.rs:123:1:129:1 | exit test_match (normal) | test.rs:123:1:129:1 | exit test_match | | +| test.rs:123:48:129:1 | BlockExpr | test.rs:123:1:129:1 | exit test_match (normal) | | +| test.rs:124:5:128:5 | MatchExpr | test.rs:123:48:129:1 | BlockExpr | | +| test.rs:124:11:124:21 | PathExpr | test.rs:125:9:125:23 | TupleStructPat | | | test.rs:125:9:125:23 | TupleStructPat | test.rs:125:28:125:28 | PathExpr | match | -| test.rs:125:9:125:23 | TupleStructPat | test.rs:126:9:126:20 | PathPat | no-match | -| test.rs:125:28:125:28 | PathExpr | test.rs:123:5:127:5 | MatchExpr | | -| test.rs:126:9:126:20 | PathPat | test.rs:126:25:126:25 | 5 | match | -| test.rs:126:25:126:25 | 5 | test.rs:123:5:127:5 | MatchExpr | | -| test.rs:131:5:136:5 | enter test_infinite_loop | test.rs:132:9:134:9 | ExprStmt | | -| test.rs:132:9:134:9 | ExprStmt | test.rs:133:13:133:13 | 1 | | -| test.rs:132:14:134:9 | BlockExpr | test.rs:133:13:133:13 | 1 | | -| test.rs:133:13:133:13 | 1 | test.rs:132:14:134:9 | BlockExpr | | -| test.rs:138:5:143:5 | enter test_let_match | test.rs:139:9:141:10 | LetStmt | | -| test.rs:138:5:143:5 | exit test_let_match (normal) | test.rs:138:5:143:5 | exit test_let_match | | -| test.rs:138:39:143:5 | BlockExpr | test.rs:138:5:143:5 | exit test_let_match (normal) | | -| test.rs:139:9:141:10 | LetStmt | test.rs:139:23:139:23 | PathExpr | | -| test.rs:139:13:139:19 | TupleStructPat | test.rs:140:13:140:27 | "Expected some" | no-match | -| test.rs:139:13:139:19 | TupleStructPat | test.rs:142:9:142:9 | PathExpr | match | -| test.rs:139:23:139:23 | PathExpr | test.rs:139:13:139:19 | TupleStructPat | | -| test.rs:140:13:140:27 | "Expected some" | test.rs:139:30:141:9 | BlockExpr | | -| test.rs:142:9:142:9 | PathExpr | test.rs:138:39:143:5 | BlockExpr | | -| test.rs:146:1:151:1 | enter dead_code | test.rs:147:5:149:5 | ExprStmt | | -| test.rs:146:1:151:1 | exit dead_code (normal) | test.rs:146:1:151:1 | exit dead_code | | -| test.rs:147:5:149:5 | ExprStmt | test.rs:147:9:147:12 | true | | -| test.rs:147:8:147:13 | ParenExpr | test.rs:148:9:148:17 | ExprStmt | true | -| test.rs:147:9:147:12 | true | test.rs:147:8:147:13 | ParenExpr | | -| test.rs:148:9:148:16 | ReturnExpr | test.rs:146:1:151:1 | exit dead_code (normal) | return | -| test.rs:148:9:148:17 | ExprStmt | test.rs:148:16:148:16 | 0 | | -| test.rs:148:16:148:16 | 0 | test.rs:148:9:148:16 | ReturnExpr | | +| test.rs:125:9:125:23 | TupleStructPat | test.rs:126:9:126:23 | TupleStructPat | no-match | +| test.rs:125:28:125:28 | PathExpr | test.rs:125:32:125:33 | 10 | | +| test.rs:125:32:125:33 | 10 | test.rs:125:28:125:33 | ... < ... | | +| test.rs:126:9:126:23 | TupleStructPat | test.rs:126:28:126:28 | PathExpr | match | +| test.rs:126:9:126:23 | TupleStructPat | test.rs:127:9:127:20 | PathPat | no-match | +| test.rs:126:28:126:28 | PathExpr | test.rs:124:5:128:5 | MatchExpr | | +| test.rs:127:9:127:20 | PathPat | test.rs:127:25:127:25 | 5 | match | +| test.rs:127:25:127:25 | 5 | test.rs:124:5:128:5 | MatchExpr | | +| test.rs:132:5:137:5 | enter test_infinite_loop | test.rs:133:9:135:9 | ExprStmt | | +| test.rs:133:9:135:9 | ExprStmt | test.rs:134:13:134:13 | 1 | | +| test.rs:133:14:135:9 | BlockExpr | test.rs:134:13:134:13 | 1 | | +| test.rs:134:13:134:13 | 1 | test.rs:133:14:135:9 | BlockExpr | | +| test.rs:139:5:142:5 | enter test_let_match | test.rs:140:9:140:49 | LetStmt | | +| test.rs:139:5:142:5 | exit test_let_match (normal) | test.rs:139:5:142:5 | exit test_let_match | | +| test.rs:139:39:142:5 | BlockExpr | test.rs:139:5:142:5 | exit test_let_match (normal) | | +| test.rs:140:9:140:49 | LetStmt | test.rs:140:23:140:23 | PathExpr | | +| test.rs:140:13:140:19 | TupleStructPat | test.rs:140:32:140:46 | "Expected some" | no-match | +| test.rs:140:13:140:19 | TupleStructPat | test.rs:141:9:141:9 | PathExpr | match | +| test.rs:140:23:140:23 | PathExpr | test.rs:140:13:140:19 | TupleStructPat | | +| test.rs:140:32:140:46 | "Expected some" | test.rs:140:30:140:48 | BlockExpr | | +| test.rs:141:9:141:9 | PathExpr | test.rs:139:39:142:5 | BlockExpr | | +| test.rs:145:1:150:1 | enter dead_code | test.rs:146:5:148:5 | ExprStmt | | +| test.rs:145:1:150:1 | exit dead_code (normal) | test.rs:145:1:150:1 | exit dead_code | | +| test.rs:146:5:148:5 | ExprStmt | test.rs:146:9:146:12 | true | | +| test.rs:146:8:146:13 | ParenExpr | test.rs:147:9:147:17 | ExprStmt | true | +| test.rs:146:9:146:12 | true | test.rs:146:8:146:13 | ParenExpr | | +| test.rs:147:9:147:16 | ReturnExpr | test.rs:145:1:150:1 | exit dead_code (normal) | return | +| test.rs:147:9:147:17 | ExprStmt | test.rs:147:16:147:16 | 0 | | +| test.rs:147:16:147:16 | 0 | test.rs:147:9:147:16 | ReturnExpr | | diff --git a/rust/ql/test/library-tests/controlflow/test.rs b/rust/ql/test/library-tests/controlflow/test.rs index 829953eaa0df..105f893e573a 100644 --- a/rust/ql/test/library-tests/controlflow/test.rs +++ b/rust/ql/test/library-tests/controlflow/test.rs @@ -23,7 +23,7 @@ mod loop_expression { return true; } - fn test_break_with_labels(bool b) -> bool { + fn test_break_with_labels(b: bool) -> bool { 'outer: loop { 'inner: loop { if b { @@ -37,7 +37,7 @@ mod loop_expression { true } - fn test_continue_with_labels(bool b) -> ! { + fn test_continue_with_labels(b: bool) -> ! { 'outer: loop { 1; 'inner: loop { @@ -83,7 +83,7 @@ mod if_expression { } fn test_nested_if(a: i64) -> i64 { - if (if a < 0 { a < -10 } else { a > 10}) { + if (if a < 0 { a < -10 } else { a > 10 }) { 1 } else { 0 @@ -91,13 +91,15 @@ mod if_expression { } fn test_nested_if_match(a: i64) -> i64 { - if (match a { 0 => true, _ => false }) { + if (match a { + 0 => true, + _ => false, + }) { 1 } else { 0 } } - } mod logical_operators { @@ -116,10 +118,9 @@ mod logical_operators { let d = a || (b == 28) || c; d } - } -fn test_match(maybe_digit: Option) -> { +fn test_match(maybe_digit: Option) -> i64 { match maybe_digit { Option::Some(x) if x < 10 => x + 5, Option::Some(x) => x, @@ -136,9 +137,7 @@ mod divergence { } fn test_let_match(a: Option) { - let Some(n) = a else { - "Expected some" - }; + let Some(n) = a else { "Expected some" }; n } } @@ -148,4 +147,4 @@ fn dead_code() -> i64 { return 0; } return 1; -} \ No newline at end of file +} diff --git a/rust/schema/annotations.py b/rust/schema/annotations.py index eb32921a0c43..dc4cecfcbebf 100644 --- a/rust/schema/annotations.py +++ b/rust/schema/annotations.py @@ -122,7 +122,7 @@ class _: 1 } else { 0 - } + }; ``` """ @@ -426,9 +426,9 @@ class _: """ A unary operation expression. For example: ```rust - let x = -42 - let y = !true - let z = *ptr + let x = -42; + let y = !true; + let z = *ptr; ``` """ @@ -581,7 +581,7 @@ class _: An expression statement. For example: ```rust start(); - finish() + finish(); use std::env; ``` """