diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index bc4fb9f23bb0..f42e102de588 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -13,7 +13,7 @@ lib/codeql/rust/elements/BecomeExpr.qll 7a3cfc4894feb6be1cde664f675b18936434e68c lib/codeql/rust/elements/BinaryExpr.qll 394522da3bc3a716fc7bc40c3560143ca840f5d210cfcba2a752c3026dd0f725 fbbd6fb79bf16a7d9820613654c584cd7ff3e7a29988f3920b6cfbe746acfd8d lib/codeql/rust/elements/BlockExpr.qll b952fd44b89de248931d4089834d2c9406f6f2fc1a3f5c2365156be4e55157cf daccc07ab11ac696679b9fadc99f40b1bf579c90bf6c7cca6e82eaa313932ede lib/codeql/rust/elements/BoxPat.qll 1b2c3fff171aa6aa238c9460b122f26c79e04577cea67fa856de99842ba873d4 0caf8d23ed6e0997a6b8751def27641582151fba6e24fccf798712a4690b42f1 -lib/codeql/rust/elements/BreakExpr.qll 0b0e1c3bb027acb8a3144cac4bd5043ec4af2160a186c9ef41e1d4f8d9c605e3 caaf17700c95b35fa5806fa6b21e4d89b7bd53e32b884780c7f1ff46702b978a +lib/codeql/rust/elements/BreakExpr.qll 7ca3807a20e9a9a988d1fd7abebf240325ed422fcb45c719ba46272f031f94db dffb7379d3f3ba220acfbd05eb7bb6cfd9cfda211e9c8b1f5240ca5fa61be3fc lib/codeql/rust/elements/CallExpr.qll 6760ef2753fcaa9f02860bfeadfd1b1603d0d5b35f5dd72b33a474c206f51a29 55afe003eb51ef28b382af368429930d858d291bb7d76d71149eee1c805731f1 lib/codeql/rust/elements/CastExpr.qll ba281bde130f43c486c4ad889539b77fba9e41afdf7980e50b6a8696a1ec7527 61257003d395896ec60729d0bc01da36697615bb725d07141255fbb5c44e50a0 lib/codeql/rust/elements/ClosureBinder.qll 977df800f97cc9b03fffb5e5e1fc6acd08a2938e04cb6ad91108784a15b0d510 f6fad4127226fe1dff2f16416d8a7fde5d8ab4a88f30e443ac5e5ff618de3e05 @@ -181,7 +181,7 @@ lib/codeql/rust/elements/internal/BlockExprImpl.qll 36ac09e4a6eeeec22919b62b1d00 lib/codeql/rust/elements/internal/BoxPatConstructor.qll 153f110ba25fd6c889092bfd16f73bb610fa60d6e0c8965d5f44d2446fcd48a2 9324cf0d8aa29945551bf8ab64801d598f57aab8cd4e19bcd4e9ef8a4a4e06eb lib/codeql/rust/elements/internal/BoxPatImpl.qll d62a3cc1d5bab6bd258f702ec731ec57f0e5ef2672ab9de4b6f3b558078629eb 26b4fabb676adbbdb0d7f81449e493ee49380ea04d131f779714ac2434bb323a lib/codeql/rust/elements/internal/BreakExprConstructor.qll 356be043c28e0b34fdf925a119c945632ee883c6f5ebb9a27003c6a8d250afd9 bb77e66b04bb9489340e7506931559b94285c6904b6f9d2f83b214cba4f3cfd5 -lib/codeql/rust/elements/internal/BreakExprImpl.qll ab01a4db514ccccf286f7bc0537456dc07c288c83b79f024bc24a3ebe7af706a fcbabae9b526741ea4518c138317ad2aed4069126fd2bac92c5c16eaecb2e8a3 +lib/codeql/rust/elements/internal/BreakExprImpl.qll 883ac0e2c0856c91f50747cf10cbcb3ecab535f6858913f2fa34236db8d211d6 5b20db08f16ea5ea3554ffbf6a2a69107e1ec8e3f31dd3935f8839b9a498f4bb lib/codeql/rust/elements/internal/CallExprConstructor.qll 742b38e862e2cf82fd1ecc4d4fc5b4782a9c7c07f031452b2bae7aa59d5aa13a cad6e0a8be21d91b20ac2ec16cab9c30eae810b452c0f1992ed87d5c7f4144dc lib/codeql/rust/elements/internal/CallExprImpl.qll 7e48610680ba6f2876a1a005ab0743496dd2364b9c44aca441bd33e11317e2d7 bb12c3c28156b40796fe3ba112760f87bb5abb323aab3c5b7bb3e0facaef8d35 lib/codeql/rust/elements/internal/CastExprConstructor.qll f3d6e10c4731f38a384675aeab3fba47d17b9e15648293787092bb3247ed808d d738a7751dbadb70aa1dcffcf8af7fa61d4cf8029798369a7e8620013afff4ed @@ -457,7 +457,7 @@ lib/codeql/rust/elements/internal/generated/BecomeExpr.qll 7a211b785a4a2f961242d lib/codeql/rust/elements/internal/generated/BinaryExpr.qll 64e9bd9c571edd6e5f3e7662b956b1d87fa0354ce6fe95da9caf25ac16b66c68 3fca09fdbe879db2ca3293618896a462e96376a2963d15cce3d5b1baac552fcb lib/codeql/rust/elements/internal/generated/BlockExpr.qll 6fc90a80e60f017bf3418e45bcc35b5ddac59b51037c21aed3955d47c147ce4a 1f3f8e5107b0c6de381b7c94aab93dc5fd758a845c6ff9554888df453f1315d0 lib/codeql/rust/elements/internal/generated/BoxPat.qll ec946a3e671ab7417e04b0207967adad004df512c570c4f0780ca5816d12d75f b0e64860855c4e85914042b1a51034899ff7cd1b2c6857188de89310a2726ea3 -lib/codeql/rust/elements/internal/generated/BreakExpr.qll a5e9576bde3d9dca3b1321a4f5348306b6b5593e9fa39769df00645d80b68f6c 25f190aaa10ab71315947d544c5ef8eedb701a0e665e282031062006c6d3d175 +lib/codeql/rust/elements/internal/generated/BreakExpr.qll 0f428a8b2f4209b134c2ffc3e1c93c30bc6b0e9c9172f140cefa88c1f77d8690 957b39f38ff6befe9061f55bc0b403c2f1c366dd0cf63b874bae6f8216576d76 lib/codeql/rust/elements/internal/generated/CallExpr.qll c2700dbd9c33dcc14de10dc72ff49abafdf0952257864d4435cf8ac46849a2ee 7932f725f97ffbe1b050c2622a61a0d56f18c9264a3293466cba9915313495b5 lib/codeql/rust/elements/internal/generated/CastExpr.qll d6fbf02e9e202254666082a9116634d0eb933177866ac4c0a57b5e9c4bb4b383 477f67773492e3b82695461d56327c9db05a7d1a67e8d192406265f2ce369670 lib/codeql/rust/elements/internal/generated/ClosureBinder.qll 94c0dcdd4cd87d115659d496c88a98354bc7d4ddc0fa27028003bf7688b99987 d59d713b426dbbdb775df9092d176eea031dac1f14e468810f2fc8591399cd19 @@ -543,7 +543,7 @@ lib/codeql/rust/elements/internal/generated/PtrType.qll 5f12b6ad29b4e5ce51c205e2 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 2a2939bffd64f073912aec93dfe7e26b35aeaa4746bc21ffbf21575bab71f9b1 6ac30484d43ee941e7789626ad6c115aff91f5088c49afbb4dce01dcac45a7f8 +lib/codeql/rust/elements/internal/generated/Raw.qll 8361be3a8ed615b08c49bff624b84f1c7ee26c01265494e9969d22abc83101f3 c16a5bb379cc38faabcc4525820729a7a837ab5c427da41bff228d1ecd181247 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/BreakExpr.qll b/rust/ql/lib/codeql/rust/elements/BreakExpr.qll index 0776fe2bd01d..8aec2220dc7a 100644 --- a/rust/ql/lib/codeql/rust/elements/BreakExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/BreakExpr.qll @@ -24,5 +24,13 @@ import codeql.rust.elements.Lifetime * } * }; * ``` + * ```rust + * let x = 'label: { + * if exit() { + * break 'label 42; + * } + * 0; + * }; + * ``` */ final class BreakExpr = Impl::BreakExpr; diff --git a/rust/ql/lib/codeql/rust/elements/internal/BreakExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/BreakExprImpl.qll index 6b1a9eb9ec8b..031761d374ed 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/BreakExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/BreakExprImpl.qll @@ -28,6 +28,14 @@ module Impl { * } * }; * ``` + * ```rust + * let x = 'label: { + * if exit() { + * break 'label 42; + * } + * 0; + * }; + * ``` */ class BreakExpr extends Generated::BreakExpr { } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/BreakExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/BreakExpr.qll index b2a0e92d1331..dae4a83377cf 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/BreakExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/BreakExpr.qll @@ -32,6 +32,14 @@ module Generated { * } * }; * ``` + * ```rust + * let x = 'label: { + * if exit() { + * break 'label 42; + * } + * 0; + * }; + * ``` * INTERNAL: Do not reference the `Generated::BreakExpr` class directly. * Use the subclass `BreakExpr`, 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 fe559ef3fb2d..b2f4842a761d 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll @@ -1361,6 +1361,14 @@ module Raw { * } * }; * ``` + * ```rust + * let x = 'label: { + * if exit() { + * break 'label 42; + * } + * 0; + * }; + * ``` */ class BreakExpr extends @break_expr, Expr { override string toString() { result = "BreakExpr" } diff --git a/rust/ql/test/extractor-tests/generated/.generated_tests.list b/rust/ql/test/extractor-tests/generated/.generated_tests.list index 92acb5f72d33..79ffae11f0cd 100644 --- a/rust/ql/test/extractor-tests/generated/.generated_tests.list +++ b/rust/ql/test/extractor-tests/generated/.generated_tests.list @@ -11,7 +11,7 @@ BecomeExpr/gen_become_expr.rs ab763211a01a2ca92be1589625465672c762df66fa3d12c9f1 BinaryExpr/gen_binary_expr.rs 5ea68396dc2e3ff7fcaf5a5201636dd175dd45be36647b6ae0043c765ce24549 5ea68396dc2e3ff7fcaf5a5201636dd175dd45be36647b6ae0043c765ce24549 BlockExpr/gen_block_expr.rs 17b06c726e304e0efcfde8e71afd9c657860312be554366894236125cb08719e 17b06c726e304e0efcfde8e71afd9c657860312be554366894236125cb08719e BoxPat/gen_box_pat.rs 1493e24b732370b577ade38c47db17fa157df19f5390606a67a6040e49b501c0 1493e24b732370b577ade38c47db17fa157df19f5390606a67a6040e49b501c0 -BreakExpr/gen_break_expr.rs 5240475a75b772ea45ab5a9d4f09a8fbba4a9d3e6cd8483fc2d0de29c880eac8 5240475a75b772ea45ab5a9d4f09a8fbba4a9d3e6cd8483fc2d0de29c880eac8 +BreakExpr/gen_break_expr.rs aacdf9df7fc51d19742b9e813835c0bd0913017e8d62765960e06b27d58b9031 aacdf9df7fc51d19742b9e813835c0bd0913017e8d62765960e06b27d58b9031 CallExpr/gen_call_expr.rs 013a7c878996aefb25b94b68eebc4f0b1bb74ccd09e91c491980817a383e2401 013a7c878996aefb25b94b68eebc4f0b1bb74ccd09e91c491980817a383e2401 CastExpr/gen_cast_expr.rs abd59cc7b92578b56098ac0045cf7de4b15c645cce79e3bdad8d3b6f4657360d abd59cc7b92578b56098ac0045cf7de4b15c645cce79e3bdad8d3b6f4657360d ClosureBinder/gen_closure_binder.rs 78d3219bdfc58a22f333e3c82468fc23001e92b1d5acb085de7f48d7d1722244 78d3219bdfc58a22f333e3c82468fc23001e92b1d5acb085de7f48d7d1722244 diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.expected b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.expected index 5bcf55883232..763fae60866a 100644 --- a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.expected +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.expected @@ -1,2 +1,3 @@ | gen_break_expr.rs:7:13:7:17 | BreakExpr | getNumberOfAttrs: | 0 | hasExpr: | no | hasLifetime: | no | | gen_break_expr.rs:12:13:12:27 | BreakExpr | getNumberOfAttrs: | 0 | hasExpr: | yes | hasLifetime: | yes | +| gen_break_expr.rs:17:13:17:27 | BreakExpr | getNumberOfAttrs: | 0 | hasExpr: | yes | hasLifetime: | yes | diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.expected b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.expected index 3cfe6ec4437c..0bd373a4bbc1 100644 --- a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.expected +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.expected @@ -1 +1,2 @@ | gen_break_expr.rs:12:13:12:27 | BreakExpr | gen_break_expr.rs:12:26:12:27 | 42 | +| gen_break_expr.rs:17:13:17:27 | BreakExpr | gen_break_expr.rs:17:26:17:27 | 42 | diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLifetime.expected b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLifetime.expected index ebee95c1ac94..b993a2eebf5a 100644 --- a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLifetime.expected +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLifetime.expected @@ -1 +1,2 @@ | gen_break_expr.rs:12:13:12:27 | BreakExpr | gen_break_expr.rs:12:19:12:24 | Lifetime | +| gen_break_expr.rs:17:13:17:27 | BreakExpr | gen_break_expr.rs:17:19:17:24 | Lifetime | diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/gen_break_expr.rs b/rust/ql/test/extractor-tests/generated/BreakExpr/gen_break_expr.rs index cd40541da9c4..0f7d3ec6246d 100644 --- a/rust/ql/test/extractor-tests/generated/BreakExpr/gen_break_expr.rs +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/gen_break_expr.rs @@ -12,4 +12,10 @@ fn test_break_expr() -> () { break 'label 42; } }; + let x = 'label: { + if exit() { + break 'label 42; + } + 0; + }; } diff --git a/rust/schema/annotations.py b/rust/schema/annotations.py index dc4cecfcbebf..b4c647f2654b 100644 --- a/rust/schema/annotations.py +++ b/rust/schema/annotations.py @@ -289,6 +289,14 @@ class _: } }; ``` + ```rust + let x = 'label: { + if exit() { + break 'label 42; + } + 0; + }; + ``` """