diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index 5c21f4e905104..bdb9bcabafc11 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -1,6 +1,6 @@ lib/codeql/rust/elements/ArrayExpr.qll aa558ac94bb7c45145e4788ed1a92e2873c5f57f1a0c7b7faf341f40027cf455 874da62a3d6467af7ae11045229135f8f5229cff33f3edae5b01a5b9afe86dd7 lib/codeql/rust/elements/AstNode.qll 2069047c779514867c12d845dcdf889db6f27fa6a9e484966a3c28a77973b7d4 e214616c81418b0018c0d36896ac2ec7273634e3213bc8257d8b172f396c00ee -lib/codeql/rust/elements/AsyncBlockExpr.qll ce6484a28403bc36e261ae6931b02a15db6fc54cc0c1bfc441e33d7284f6c74a e5b3c00f74543a6ceeaef053aaa1f00006026b8242efbeb7e1e9633e68cc4844 +lib/codeql/rust/elements/AsyncBlockExpr.qll 7cc9709af8c5f844fd6bf6d4cf49e245d19a0ab6d73ef69e84888a4a9b8e47ce 2f9ede385321df47d2e4ac1297d07be987ff53a576a8dded9a615ad83fba6de3 lib/codeql/rust/elements/AsyncBlockExprConstructor.qll 2d7d22caca1984e850d723f9ddd581530734bf4c31c545ea598bc27144a32f1b bf2ff9edff95db8400017b7583d6881581c431755c70e0068a495787993010f9 lib/codeql/rust/elements/AwaitExpr.qll 310cf2cf155bc472caed76f596d7f789e9fa19c24d73dc0235d601ff9f32de40 d4b53d79a12d4378eebe2211b37b0f819177620b86a3eabfbec4096adfd200c4 lib/codeql/rust/elements/AwaitExprConstructor.qll af0dfdf36b300d412a7b8668f68e6594fe3338216cdf1aa420c9a58608aa86f5 cfa115902ccf070e34ee451bc2f89295c97e8418501359a8cdc646d16c4cc7cd @@ -10,7 +10,7 @@ lib/codeql/rust/elements/BinaryOpExpr.qll d85404c249175283d7ac7daada3951f47b19ef lib/codeql/rust/elements/BinaryOpExprConstructor.qll efa89c084def020961641772f4829fc54bf718817831d4752b9bf403ce0e61dd d7937326ba08410fc3ba37e44b76530804f492177ef5e62dd416094e1e2f9bd6 lib/codeql/rust/elements/BindPat.qll f0209f781d8a14ab7fbb4b4d6a654469aecb0ff1a8ff4810f18a90f3b171e1c3 9734b7907855e46eeded6c3f59912a16212f7e8639fba35c740bb04462240287 lib/codeql/rust/elements/BindPatConstructor.qll 2bbcc296bcdcd945313d83294b90d327c51c9f1e96f92d37dd10bf0c32dfaf6a 612b4fc651f32129155727e866796edee8fff939614c6fd0b7baa1392930a38c -lib/codeql/rust/elements/BlockExpr.qll cd7a978d3ad15156467ee213d65ef0dcc806af43888d1de4635e875b2d76f5fb b0286039d03f2f554ab5c31b902386357e19127d35f70211b1373d591053ed8f +lib/codeql/rust/elements/BlockExpr.qll b699906fba2dee34699e110b8759419079a5ce3dc1fab207001c9c9b612dac5e 429016df600e3905bd235d0e707c50ecdbf12b3ceddedcbf48944ea76e60f915 lib/codeql/rust/elements/BlockExprBase.qll 1b24ea5fd43dce0e240e1d7740a062228c19e8c704f6ce26503ddbd65c6f5282 d2e05a51d3840caf4de4cca6cdab9551f396df317c8ad1da661205aa822646cc lib/codeql/rust/elements/BlockExprConstructor.qll 7fc9214582f0e6e8b4db06f7c6ac3712dc260abc12ff65f3e93bec5f210b0098 13bc676b67ed14b326e4bdaaa43b497ce486dc2c3145a76a25fe960c82a6ba54 lib/codeql/rust/elements/BoxExpr.qll 02e6f063c8e2aa01b12eb3223783e8d88330f4faadd71fef253b5dd39af8b556 bda6357d99430b524de82be0da444cc180dde9ba1f3e08c1bd4c53143789fcf0 @@ -27,7 +27,7 @@ lib/codeql/rust/elements/ClosureExpr.qll 2a8b0a94e37b8406acee038ae0737604174b306 lib/codeql/rust/elements/ClosureExprConstructor.qll 238dceb78082a5566276640d4aa31484041700852c0751130d139a69ac8bde46 7aae22930def4d438d742255731cc59b78a95b73a0b1d6334ae9965e083e03bc lib/codeql/rust/elements/ConstBlockPat.qll af7f5f1a8de38266a12e92dee4a5ef5279baccf542cf2c52d982ed075d3bec27 1208223d97230a90d9377164b61454dcc6ca0f46a408e4a5ab2a82340bc92eb3 lib/codeql/rust/elements/ConstBlockPatConstructor.qll 04aa8b4f218ce87157f0d6b10c9c04660c34c90af1f121b1432402de2e5114cd 34e2fecbe91ea9ac1626bc27121a7d5abe99855e3f49bdca12a1969b42ac0ba5 -lib/codeql/rust/elements/ConstExpr.qll df129a4a1f65c07076e15097571ffd12b91a63d3ded97bb3173b50a7f1279bb4 dd3b7a5230baf5d1a062d49324eeb6ee5a76f156944ec149da8bf46c982107b8 +lib/codeql/rust/elements/ConstExpr.qll 70a7c9db14efaf290a77401eb04c439b24ed77c21496cee53b89d92d350daeaf e3f98ac4dde94a4dc8d6df51ba4ecd4acc492d9de569ac3eee9dd3bc258bd03d lib/codeql/rust/elements/ConstExprConstructor.qll b4c96adc2878047c36d7ceaba2346ef66a2269b5260a56c3d7ff6e3a332bad75 ce15bbfd1448e47d3039e912363efa607cc2c29d44b8248ac91c307af7b57016 lib/codeql/rust/elements/ContinueExpr.qll 46635ab257d8cc8ab3ba4b6786df7a2ff4d2e6360578bebde8bec1d6ae90b8c7 a0c60fb018ced67e1d6eed1c493b2c6d729636f1325b556ed5bcbcff072cd8d7 lib/codeql/rust/elements/ContinueExprConstructor.qll adc5c5b4fda5dc5102cdace41c32a6c94fe07a2e2555ced6ee62a2d2551b90a2 9dc5045b0d91a3a28cc1c0d59c6fd40620257a6c18ea8480792183c4d802fd8a @@ -44,7 +44,7 @@ lib/codeql/rust/elements/ExprStmtConstructor.qll 28e37020abdfce5a8666b0c9a3147c3 lib/codeql/rust/elements/FieldExpr.qll 1e3d84c3eeeeefa1837b5359f7289c0f03122848b6f95fdb362cfd947304e107 28a6f8201b435b87705afcb8088d017fa699f60be3aefe03dd56f978ac7954d7 lib/codeql/rust/elements/FieldExprConstructor.qll 75bd0526fae157460750f3ea1e087c857cc703fca03d34f1f478b57ee8051590 1e5555910c643235e34b73f9844e894e51f357c3f7aba8165c47caa147336c53 lib/codeql/rust/elements/FunctionConstructor.qll a9269b37182c0bf432f9b2b015691da5dbd64819b9bd25445af229d873014a91 69107a7503af14a51e091e6918094a4e9fc316a72de2e1514f001872ce0f2c0c -lib/codeql/rust/elements/IfExpr.qll d5461ea0370765b9dd0c5aae298e53c9b3d84bacc783991fb9dceee44c87e8fb 90c5f959144c767bc8f10b322489264b076c33f19af0d19e97a08d083f76913b +lib/codeql/rust/elements/IfExpr.qll 87d29f7f6eec05e03d3e929e32b526787f41d5320141bfe96028973e15ef225d 42789266b2c54b222c1d980f85e3150c80397668e61c9952df6905f1bf0fc4b0 lib/codeql/rust/elements/IfExprConstructor.qll 961ac42fe811db7c56c9d85e98724a87571e8543265c0424a7b61f26ef41b369 43d9412a22908a7e5c38f1f5e8f88162367407b71037f469dfb7d8dfdc3a063f lib/codeql/rust/elements/IndexExpr.qll 0729277577ffe82d6dbc8fd275a70de59a3926aafea730e622ecbbca7b84e313 c9bc5616664e072fbaef2b89d4047f5f7e28d002cca2fa17333f29db80adb284 lib/codeql/rust/elements/IndexExprConstructor.qll 37e70c773123d775b6281514a2727e133e02fa87e774076f857a676697a1f2ba da2ed2819a13ab7c526b74c1c375ab2fce63ed17f61d5b29e4212343d6b77d06 @@ -54,7 +54,7 @@ lib/codeql/rust/elements/ItemStmt.qll 70fc3f9df9794dc78199dfd81b8136701d4ca0c9b3 lib/codeql/rust/elements/ItemStmtConstructor.qll cd27051f73ab2897b1f7a725313f97d36507fc9f5e0dd7b2ad8bd1caaf8c42ad 67596c97386fbe6cb9e5e6abc45b674158f411d927297345cb25359587380bcd lib/codeql/rust/elements/Label.qll f48209b24876d581e95120bc548c44033b6552a7875eea73ce44aa57b675eeb3 d17163f3adc9f94a462269f565153aa2822533d03487e521d9c5d5e72afaa1ac lib/codeql/rust/elements/LabelConstructor.qll 0625a149cb34b9f603b76efd76e679bb63808d47f9fa529959784347d8e7d447 2115bc7de878af444777f96247bc0a775161f3766e38c3c4d363c2f59b2144da -lib/codeql/rust/elements/LetExpr.qll 986598132db0cbc861adc641e633a54b7651ff5f3bc52b5e2f4e84733b774fb5 e61ed80a6732fb344498c8eedf3b787546eaa38f203265e9a3195e93d3534a19 +lib/codeql/rust/elements/LetExpr.qll 49a9ba97471d04d52bee73f9b5651bec09fae40c5779db59d84b69a3e04c0a4f 682c504fb507855c96833677225c4ddafc20dee75f8203e0dc110aeac89fa2f7 lib/codeql/rust/elements/LetExprConstructor.qll 8904b25d70fd0e6f3db74d2e09bb3e3fee407282ee45030fdaeac31b6111db70 36dcc877f6c1810228d593d914cffa7b04ecf0afe13c4c122aca72f33d03f566 lib/codeql/rust/elements/LetStmt.qll f9e28ca0123e2a6e1f6115821282440397cf2647577b4bfc4d00cbb4312d8eea c65442707090461035160ce830c4c0a85d1fe626f03026c13ebc4be06ec96905 lib/codeql/rust/elements/LetStmtConstructor.qll 5882f0e4379d07e8281a955c9eed7dd907b610750887de3dd6451cd1c8d104d4 68b0890d8a493dcca74190904b00f05b0e58aacfe5a2aa63e5ead1ba366d3c38 @@ -70,7 +70,7 @@ lib/codeql/rust/elements/MatchExpr.qll 87eea89af08e7b9e4dc958aae0d35035fa8cee5fa lib/codeql/rust/elements/MatchExprConstructor.qll 74df937d7d8bfbfb02bdbf095595eb3f2129ed4c0854bae6d73b5b38d4fc902d 5c388c02f02462d843945111b72de12bce33c7c332d55993d903aeb250213407 lib/codeql/rust/elements/MethodCallExpr.qll 2dd115a2e5ac298d9a81cab2718b7abdbe52825938ea88115913c82a0f2f7751 9733c353b9e6703ef812eb8b6395db49d6d656460c575dbd75d67fa96784a33c lib/codeql/rust/elements/MethodCallExprConstructor.qll c9e1137ba6b76eabd941ecaa27a5b43b6fc3ff445ad46d3f625ad086de0e0af6 47bc4c30182b891c7009ba536edad7393dc068b72d9dfc16b26174b15d49748e -lib/codeql/rust/elements/MissingExpr.qll 2158f064d027975e3faba6a858b8e469c324544ae0923319b149fd5ec6548448 500ef109ceb36f5da72040fc733c7e98f94920f51d53d90fff3d86f85da0aad3 +lib/codeql/rust/elements/MissingExpr.qll 30b04d6a7b67acbce40dc1ffb95edb833578fd50ac7165213913b6c83d3181a8 444fb33c01ef6a311539f5b8a3159034aeabbf0284d192139e64c3e66ef0a18a lib/codeql/rust/elements/MissingExprConstructor.qll c51f4f6e897ef2107a27bd91ecf31ce875611b29a5a12238d5312b9489a35b8d b9ea3fdae459aba6c7ed9eb48edbc5bdbdb4cb41220fff81ed4cd256648612e0 lib/codeql/rust/elements/MissingPat.qll eacee2eaede4adb8452a41c14c95c310d0731c2c60fdb818b3e94e34f418aed4 9f81567e8e9c02be0994764a082a2135a6bec952456c2413295f2b0a16e5eb5d lib/codeql/rust/elements/MissingPatConstructor.qll 7bff2fb7fe96388dd703cca5f0bb1d04cea5d1f0729bb54c6604b58e338c7d6b eec9fea46593b3850da111658848cb54cfa9992286eeee313a55def184cf7ec5 @@ -133,12 +133,12 @@ lib/codeql/rust/elements/YieldExprConstructor.qll ff46ba17cc24abfcb0e310c7458d05 lib/codeql/rust/elements.qll c0e6bff934b1925ec03e55afc2b5b9127f51dc4a613e047e687bc83cdab4f196 c0e6bff934b1925ec03e55afc2b5b9127f51dc4a613e047e687bc83cdab4f196 lib/codeql/rust/generated/ArrayExpr.qll b9778720acf4080c065897ba1471be185c0c35f3ea01c15594c0a3ee4029b231 cbc8c9dbcb805063c4b893e21ed0bf00312490a0c92ee126d49dbfff6978fa99 lib/codeql/rust/generated/AstNode.qll 0598fac7859906f4103124270dfb2fbdb838387b1c45000bf50a4b62c797ec41 f47c84878c7c9676109e358073bddab92a1dbeb4d977d236ecc1eae44d81c894 -lib/codeql/rust/generated/AsyncBlockExpr.qll 1e9d3bcd5d5703bf61748f2746d3f9a4e2a12080268b29a2685b762d13c30555 1e9d3bcd5d5703bf61748f2746d3f9a4e2a12080268b29a2685b762d13c30555 +lib/codeql/rust/generated/AsyncBlockExpr.qll 4038dd9d888f98e8848de4ab858804bbb6dd835a32e925a9530f350820edaf04 4038dd9d888f98e8848de4ab858804bbb6dd835a32e925a9530f350820edaf04 lib/codeql/rust/generated/AwaitExpr.qll 4b5fccfee29fe28dc85df19b4e6677bf565dacba92a0984bb7ca444650852970 0c0be7ea53e41c7708aa84b93d037fa9df2f72e5a676d78e217ca006f21b548f lib/codeql/rust/generated/BecomeExpr.qll a4cde707b7372dd4c48f9b4a450b6ea710085f323878fc17c58f92cf7d50fef9 44f0fa714080eaf6dfe9fecc422b1aa161375b73eb5536ef8bb40b793d8f48ab lib/codeql/rust/generated/BinaryOpExpr.qll fe0a286df10f5eaaaba60c74dfc5ef2c17736f24aadb718271e8a17eae736ba1 1f13e04bd6089b956db807e5e0ab974382ef7b5a7271f290a7ae5f75a857a30c lib/codeql/rust/generated/BindPat.qll 15d3a33c5f56f7659a331f72735f00930fddd6066659e54c5c19d5e7eb8ef078 bc0a916622b2c426b71760caf15b8e005eed276e06e04d04cc5f19f4c31c34f6 -lib/codeql/rust/generated/BlockExpr.qll baf05a376d4c65505d3aa52eb893e1d8d02a8ef8b16bb40d4a59ee10c7d97b5f 789eccc236d0b4d3adf3dcde699a5f3097d333514455776f74b9184aa14fddb0 +lib/codeql/rust/generated/BlockExpr.qll a04d98a1b846a78d5df7c9340348bdc0d4e27f1aebf81ecc389f90010aeb9f39 caa43e2ab10a401af6813218318a970efd60eba23bfaca3210954be277cddaa1 lib/codeql/rust/generated/BlockExprBase.qll f651ce968170b6e05e555924f8004d55b85ff0ae59bce4fea0804691cef0cf66 6ece8056e83d047fc27cdf1110fac166c0d1ba0e26a8d4a7a7cffc05bd6b3b42 lib/codeql/rust/generated/BoxExpr.qll 880f550a9a6c861efc6310a72830a50bbfdb11982e99f11b5d3f4c6d1fbe826d 380f021014738c86e5745b3320e65a8147ceb30511aa51526a7fab4278a1ecdc lib/codeql/rust/generated/BoxPat.qll b69ba2bc341a1bf4c613279e45fb97a530619d4148d5ccc4f05436a316db29eb bf52730243bd1836d5890c745232aba50544c2046d00e80e7d22eebcd104f821 @@ -147,7 +147,7 @@ lib/codeql/rust/generated/CallExpr.qll 3e29dc45480e3be1989c364bad0ff94deb322cff2 lib/codeql/rust/generated/CastExpr.qll 6ed07afb453706874d7ae7c4bb09ed35ffdd11e7aeb4cbef4d84dad11a203d0f 741d1c0ff092dc9273b0d588aea6b30f7e2c1c5b9d08f2c4722fe26c2cab33ab lib/codeql/rust/generated/ClosureExpr.qll f0c7ce7aecc9da9663cbda3e285be73b23464f8baa6b966fb5aebb0bd0f0aca6 685d74b6a94052fc45aff83b7c525a83f9dfcc02c1bf7e7f7a0aed51ce2de945 lib/codeql/rust/generated/ConstBlockPat.qll d0818fe4cee066f1e6d3439c82122942ae62941e69da686b7d5c399e820c395c 2fae5a2f0457bb7106d52ac7457afb597d7ac9658b8dcff8e76294f5fe34019a -lib/codeql/rust/generated/ConstExpr.qll dd851fb049429fe965569beb75957a6a596137b333a6cd7cd588d1c4d40412c4 824825bc46a393827d5df5ae30f622ef2a053ea1f5e338c3b957625a8542cfa5 +lib/codeql/rust/generated/ConstExpr.qll 7bd3d75822259d2ac61bf3bab6a233948617fa09a7a3d48991b643f0c842925d 06785e5b723006a8c51cafda5b8ce3901e0ddd3aeafc0d3c80e61b9389830e85 lib/codeql/rust/generated/ContinueExpr.qll 436847767d2f68f95d011df0eb8a175924c029ac747daf620a203596479b20b3 e362f28dde0bf3e6ff3b234e81a44bc5026b4c9ed38b8b7872954cca9565eece lib/codeql/rust/generated/DbFile.qll 4dbf1931124291e0d6a958ae882f8aeef006642f72adc7ff86cffd3a4e9a970a 4dbf1931124291e0d6a958ae882f8aeef006642f72adc7ff86cffd3a4e9a970a lib/codeql/rust/generated/DbLocation.qll 735d9351b5eb46a3231b528600dddec3a4122c18c210d4d632a8d4ceaf7f02e9 735d9351b5eb46a3231b528600dddec3a4122c18c210d4d632a8d4ceaf7f02e9 @@ -159,12 +159,12 @@ lib/codeql/rust/generated/ExprStmt.qll f35543fe1481f768eb8abe3fd0d36e2dedf00f0d1 lib/codeql/rust/generated/FieldExpr.qll 25dd7f15ee3fe1b0de4371cab9df83d3713c1612501e5496c9a15df8d093a755 3c75b0136d1849f6de1bbd14bda4285c52d51c8a6427984c7e5302c05d706e99 lib/codeql/rust/generated/File.qll 2eff5c882d044d2e360fe6382fb55e5a45f6ccb9df323cfa1fae41eae9d2a47f 87e7a906b3a1b4de056952e288ddd7f69fa7cb1bd9dc7dd3972868a9002ac1e4 lib/codeql/rust/generated/Function.qll 84a00eb88479efdfe70fe51c3b5cb27ae64a54b48dcca1f2e02f68691b7d907a cde5b965ab27e811f0d24eb4f12bca90c3e8aec3a4c1d9b8bd0023745dfab105 -lib/codeql/rust/generated/IfExpr.qll 7d8e5bd93bb8eda6d5d6551431b0389a2ec5893bd8c13276205d6677856c8341 935bf1be8f790a52e71a6a28456f2f1a5c5cbe6e64bf20fa8602980560899835 +lib/codeql/rust/generated/IfExpr.qll 3b68ac5d7741f566081dd8ad028f762c849d02e4f1532267a7660e24335bf08f bcc6b52c950afbe4654ccdbc10d578ca9e134597cc2653daa1832fcb2bef2ab6 lib/codeql/rust/generated/IndexExpr.qll d44004268aa2e7d79e29133eb593d748beef1d4612318ef469220b3c2252a057 86892c04c59936d33f0cfd5272a04a6ef726f477c2e8f4ef27dae7240af9c804 lib/codeql/rust/generated/InlineAsmExpr.qll 246c4f255d963f20c8e71fdbd16b4555cb6243820da1d399543205010368ccaa 1ebe22203305195259963bfb90f9928a4255cae993067f6a6fcfbc62069e1b1a lib/codeql/rust/generated/ItemStmt.qll b4d2a06fdd00ea90eed2742bacf0a5781b8ad69e24df794ec075d7305220afaa b4d2a06fdd00ea90eed2742bacf0a5781b8ad69e24df794ec075d7305220afaa lib/codeql/rust/generated/Label.qll 7de504ea71f2847e305ab5ea3b30403cb0aafbaa0eb4cff3956a2931da6c024b 61e3c6a74b573aadcccefe0d4abe5d8e2542b1e5116c95f4e595b36efa3a86dc -lib/codeql/rust/generated/LetExpr.qll 896efc732db1ddc8be7281408dfeaf6f04f29d25ee1240738246e0cb31dfc2aa 14d5add4367164f4aa994cd2ae006e8b5918265dade20b41f363daf9537c6d7b +lib/codeql/rust/generated/LetExpr.qll 377099647451717af698677ca7119436982354d4e038a2097bffe8f34ac5686e 6bd51c497bcf2a684c1e6a2515e67228b0146b47a65e8d922cab54faf48b0d73 lib/codeql/rust/generated/LetStmt.qll 1f8fda11b71689fb1a1b9b25a2ce046c56f36f26cddb354805bd395a03e4db3d 80ad6ea6afb1891a02db434cfefdb95b0fb7d766af6246ff27129dc15cb48ace lib/codeql/rust/generated/LitPat.qll 92c3c0f32ab9d5b08e246231e5465fe18536dee99351f73e158048bb007baf8a 6736a7824e5bdb0cc16de1231bdb5169d2f48251d5917bf2c31a36422b0bf2fd lib/codeql/rust/generated/LiteralExpr.qll 9202e11f56a2c5e99fb98ed784c7ca043c1f5d80680b48ba4ea340dd689ebe55 9202e11f56a2c5e99fb98ed784c7ca043c1f5d80680b48ba4ea340dd689ebe55 @@ -174,7 +174,7 @@ lib/codeql/rust/generated/LoopExpr.qll e9304e282a97984e147b92ec7061c98fde238a869 lib/codeql/rust/generated/MatchArm.qll 5ad0dc254b6d58ccd856e4235b68ca0226a898c33f1f6b6fe7b48266a01ca627 f519af39f45e820eb3a70cefb0e4dfb541c3cf17952c00c6dd7e59f854a629bd lib/codeql/rust/generated/MatchExpr.qll f8b422699337324c91ec9c55024630efe114ca617f4f088a18d180df132d5754 13169bde872f533f55aa196d7150761857c593a4657ab34051346dde14e736c7 lib/codeql/rust/generated/MethodCallExpr.qll 499fa4c78bafbb8f3a6af645c26f1645c9a634976d409493d26d82dddd4b42a3 2dd18cb4868e96e38383c4ae3f8777637422e90b2363bb533f0e9e1c2692dc6e -lib/codeql/rust/generated/MissingExpr.qll 90b164567620c88b8e258fa229633365400abeafa4f4b0fcd1c856efc2f9b206 90b164567620c88b8e258fa229633365400abeafa4f4b0fcd1c856efc2f9b206 +lib/codeql/rust/generated/MissingExpr.qll 9ab4844a2d719d29a95a69d1a6f9477ded0db508f83f3e4f2101847d0486c300 f0706af7d600a4ed1dc253c9e1220e863a58cfb9334f853877b80dffadb35a3a lib/codeql/rust/generated/MissingPat.qll 0d8034cee20bacf07ebb9337c797f53a25686a149f163f801916cd6ec5484710 0d8034cee20bacf07ebb9337c797f53a25686a149f163f801916cd6ec5484710 lib/codeql/rust/generated/Module.qll 2a931a4f2cdb2fee00ed83af045ea63d36b7dbd708e58c30445b5610feaae333 cd62add5c31a509f965aa294f44a1607ec7c62e3a9e3fe9ee063b3c814f4eb62 lib/codeql/rust/generated/OffsetOfExpr.qll 58dfd632efcb48de7fe6ffbcb2192fcf95bfabdb407a751133f63a0e32ae7489 21ebb1b3d66849fc21c04083cfa751eb56c55809cd52664020bd61ccfbe5ea68 @@ -186,7 +186,7 @@ lib/codeql/rust/generated/PathPat.qll acc4dda795bae97626a8d0041538f3ba1f0b591c74 lib/codeql/rust/generated/PureSynthConstructors.qll 5eb1fc4f6a04172c34ae31e4931e4bf1f8b72fbe414c5f644731a45372d13573 5eb1fc4f6a04172c34ae31e4931e4bf1f8b72fbe414c5f644731a45372d13573 lib/codeql/rust/generated/RangeExpr.qll f499d8c1f260d6262a55c1f3640aaee832ed8c9aac922cb2e05fefbca4509053 a01563640bc23fbce9d33da756bc209fd16155dc76a7fed4ba325979723f48a5 lib/codeql/rust/generated/RangePat.qll 6ec95f6cb9c4bd93b38990bb1e3b89b526624305ac6ee7b94e6fb0a2f3db28fc 0e193f3816a7587d5103dba421bc2bf22b869522353d4e3f43d49a792eac6cf4 -lib/codeql/rust/generated/Raw.qll 48d1e7d642bd2a7605dbafe3929c558560054a4e4e3e4b36925a8bfafb7536b9 3b881e64127e9b41fee7e091de725f5cd1cb1263e4a52c02adb1fb339fe36c3d +lib/codeql/rust/generated/Raw.qll 4e414dff04606a36adbdd875ae617c4a111307718df50e27fae3c9f8852379e6 63267916346999e4c5ffc8407a5c373dc9c9268d7c4fb896cec3966348e6dfe9 lib/codeql/rust/generated/RecordFieldPat.qll 26bed2285d849b9b7ac52d86131eacb40df912db350e423e81fb98c393c08a69 05ed735aecee90901a1bdfae05d9f85d7f6581616eca3a9262fdef6673222f9b lib/codeql/rust/generated/RecordLitExpr.qll 1d3264446ff57e8b169f1ad6da150b2d457d6b60eda0ff63e2353eb8ef9e9113 f523dd5ce7f4bac0aafab7b27c6cfe766c72a9ee0c92d7a263347e67edf096df lib/codeql/rust/generated/RecordLitField.qll bc704b56a986f3a399dc9c3dc2b61cca0d40cd389c694b9fe13374780835ffcc ab6b05a87f240a97cc2a8c15bb84a1338ad33ce367619125a8514e8815fd050e @@ -212,12 +212,53 @@ lib/codeql/rust/generated/UnsafeBlockExpr.qll 8464597373ea46f6391394f02c4ceb93ff lib/codeql/rust/generated/WildPat.qll 8a2cede00ac2941cb94e294ffa81ada9ae6e61d8d8a720ce4f288740345802f8 8a2cede00ac2941cb94e294ffa81ada9ae6e61d8d8a720ce4f288740345802f8 lib/codeql/rust/generated/YeetExpr.qll 2b37cf55ec26958cf226885e99d81c8bbc6ece69fbe92d9fcc8884ee0bc4aad4 e371531507311ea8a9fbaac74442fe9994ae85f0acdb79cc870e5318af52aba9 lib/codeql/rust/generated/YieldExpr.qll 70ca98e14b24f12a3cbfe690417543fdce45b162f241834e2f7f58543aa11bda 40fe1281107317a7d80c7141229eed9c6904805dff615dfd0141ede2457e2c57 -test/extractor-tests/generated/Expr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr.ql fae7f09b653698aa78626a268711bbd8336c9d6572ab9fe85967a8bec69e33f5 91dd5893cefeb9fd45dea49962dfee5a373be790f5ab3569f79d9ffa05613033 +test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getStatement.ql de0941b5e2fad01300b77ac6db85ec37bd85b7d508b01e2b8a332c1ab9f6e787 7f9bdd81447cbc5a63b09c41a7d0edc15f826f7e672c518dc6fca08ae0107639 +test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getTail.ql 75f59d680d0f559dfc586306af2748c59c15789514a4ebca9f908ccc1fd63674 1a9f952485846fb93fc0afeabeb07845fa5c026520a0542302f971cb6b4d8e3e +test/extractor-tests/generated/AwaitExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/BecomeExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/BinaryOpExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/BlockExpr/BlockExpr.ql fd1bc52af4bad96423cb86b1eed02595e139e533f48533299e32b7b45360b47f 021b58c6e6cad40cc0707d0a78fd8c4ddbc529422d3bb9ac62c490b2abc1bb00 +test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.ql b02c87bba8bdbeffab05632133a17d36b355624d7521083cc6c0b02f88b2ba46 91141e01393ec04f4bb1f86373f5f25c837b13865ab540419050e6c547cc2690 +test/extractor-tests/generated/BlockExpr/BlockExpr_getStatement.ql 4de30a1e3c9de174688b8f9af57f72dfa6d9a2e3b3ab1b972ee69342ebd7ecad a6948240014d27fa9af7f56859cff2f8f7b44097f0bc47fbbb91b5be35e11d91 +test/extractor-tests/generated/BlockExpr/BlockExpr_getTail.ql 6df26e837dc4f8ecf6dda674dfc89b2dce25da5dc3301beba461c5c1e1776201 b4e205949d06fa355997f5a399ce1f7c381023e38be4db4ecbcec676d8ebec69 +test/extractor-tests/generated/BoxExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/BreakExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/CallExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/CastExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/ClosureExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/ConstExpr/ConstExpr.ql 644c34489fd7deb3790f9de131d958cd96102d5c09eb3b07bbf5462b3e90d253 025192a0bd742c16baf8b627f3b8216442a74c6497b752dd1207f572743a0f5a +test/extractor-tests/generated/ContinueExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/ElementListExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/FieldExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e test/extractor-tests/generated/File/File.ql dec43be882fad904fab0c6447ca93633d801cb08ff8bec309befde7d2b9e5dda 74e1f1d698558c35fa03935cc34f4c8145d376b56d7657b18aeb338f5ca752cf test/extractor-tests/generated/Function/Function.ql c49434420dbb6fc3d9e6294161dcd3d3b306fae5ba5c85b610e534b8b15ef74c fe02208b673b74eebed92b5cbb3a8a06c31c0681eb28f3e596515663f14fa9e2 +test/extractor-tests/generated/IfExpr/IfExpr.ql 4463607934fd504a6b2d65829d8e336308af6908cf12387fe8bbaa3c8c5360bd 28b5580a4e628286023b5d0de549d087f0a4224ecbb02bc7b3197d8f404b5066 +test/extractor-tests/generated/IfExpr/IfExpr_getElse.ql 4b4f3edfd0ed419fc580f3def6005760711874cc442c42ea817d70053ec07fca f97f65f91aa3f4967a2d3de836235d9c9a15f424cfced79d84f2580abf2c6077 +test/extractor-tests/generated/IndexExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/InlineAsmExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/LetExpr/LetExpr.ql b311fb10d3a65cf682ced02aa4c9b589a84cb92adc653fbe630d471d88ca5f8a 3d93cc0cda8a6f34090d3000fee4a14e31fcf0fdc4d201a8d414e27cb8b9e4f4 +test/extractor-tests/generated/LiteralExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/LoopExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/MatchExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/MethodCallExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/MissingExpr/MissingExpr.ql bb85675a4b8a8118913fd91389f8282863613edda3fb804b917cce0675a8bb76 f2e600f8fb723f8f1bde4b0b0ef41f59b4e652882b5c788e8f6767822d5574e4 test/extractor-tests/generated/Module/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/OffsetOfExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e test/extractor-tests/generated/Pat/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/PathExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/RangeExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e test/extractor-tests/generated/RecordFieldPat/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/RecordLitExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e test/extractor-tests/generated/RecordLitField/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/RefExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/RepeatExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/ReturnExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e test/extractor-tests/generated/Stmt/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/TupleExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e test/extractor-tests/generated/TypeRef/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/UnaryOpExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/UnderscoreExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/UnsafeBlockExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/YeetExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e +test/extractor-tests/generated/YieldExpr/MISSING_SOURCE.txt cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e cc7c395e7c651d62596826b1a0bedf10f35d01b8afeef47600b4ddaf804f406e diff --git a/rust/ql/.gitattributes b/rust/ql/.gitattributes index 048e925f27424..1019d217c433f 100644 --- a/rust/ql/.gitattributes +++ b/rust/ql/.gitattributes @@ -214,12 +214,53 @@ /lib/codeql/rust/generated/WildPat.qll linguist-generated /lib/codeql/rust/generated/YeetExpr.qll linguist-generated /lib/codeql/rust/generated/YieldExpr.qll linguist-generated -/test/extractor-tests/generated/Expr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr.ql linguist-generated +/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getStatement.ql linguist-generated +/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getTail.ql linguist-generated +/test/extractor-tests/generated/AwaitExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/BecomeExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/BinaryOpExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/BlockExpr/BlockExpr.ql linguist-generated +/test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.ql linguist-generated +/test/extractor-tests/generated/BlockExpr/BlockExpr_getStatement.ql linguist-generated +/test/extractor-tests/generated/BlockExpr/BlockExpr_getTail.ql linguist-generated +/test/extractor-tests/generated/BoxExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/BreakExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/CallExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/CastExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/ClosureExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/ConstExpr/ConstExpr.ql linguist-generated +/test/extractor-tests/generated/ContinueExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/ElementListExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/FieldExpr/MISSING_SOURCE.txt linguist-generated /test/extractor-tests/generated/File/File.ql linguist-generated /test/extractor-tests/generated/Function/Function.ql linguist-generated +/test/extractor-tests/generated/IfExpr/IfExpr.ql linguist-generated +/test/extractor-tests/generated/IfExpr/IfExpr_getElse.ql linguist-generated +/test/extractor-tests/generated/IndexExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/InlineAsmExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/LetExpr/LetExpr.ql linguist-generated +/test/extractor-tests/generated/LiteralExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/LoopExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/MatchExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/MethodCallExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/MissingExpr/MissingExpr.ql linguist-generated /test/extractor-tests/generated/Module/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/OffsetOfExpr/MISSING_SOURCE.txt linguist-generated /test/extractor-tests/generated/Pat/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/PathExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/RangeExpr/MISSING_SOURCE.txt linguist-generated /test/extractor-tests/generated/RecordFieldPat/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/RecordLitExpr/MISSING_SOURCE.txt linguist-generated /test/extractor-tests/generated/RecordLitField/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/RefExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/RepeatExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/ReturnExpr/MISSING_SOURCE.txt linguist-generated /test/extractor-tests/generated/Stmt/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/TupleExpr/MISSING_SOURCE.txt linguist-generated /test/extractor-tests/generated/TypeRef/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/UnaryOpExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/UnderscoreExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/UnsafeBlockExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/YeetExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/YieldExpr/MISSING_SOURCE.txt linguist-generated diff --git a/rust/ql/lib/codeql/rust/elements/AsyncBlockExpr.qll b/rust/ql/lib/codeql/rust/elements/AsyncBlockExpr.qll index e024eec6e9203..c07aaa28f5d45 100644 --- a/rust/ql/lib/codeql/rust/elements/AsyncBlockExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/AsyncBlockExpr.qll @@ -5,4 +5,13 @@ private import codeql.rust.generated.AsyncBlockExpr +/** + * An async block expression. For example: + * ``` + * async { + * let x = 42; + * x + * }.await + * ``` + */ class AsyncBlockExpr extends Generated::AsyncBlockExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/BlockExpr.qll b/rust/ql/lib/codeql/rust/elements/BlockExpr.qll index 0ba5e1a2eb8d8..f8f93be4f5c25 100644 --- a/rust/ql/lib/codeql/rust/elements/BlockExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/BlockExpr.qll @@ -5,4 +5,18 @@ private import codeql.rust.generated.BlockExpr +/** + * A block expression. For example: + * ``` + * { + * let x = 42; + * } + * ``` + * ``` + * 'label: { + * let x = 42; + * x + * } + * ``` + */ class BlockExpr extends Generated::BlockExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/ConstExpr.qll b/rust/ql/lib/codeql/rust/elements/ConstExpr.qll index 375e7dcc7fdaa..1e76306bea022 100644 --- a/rust/ql/lib/codeql/rust/elements/ConstExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/ConstExpr.qll @@ -5,4 +5,12 @@ private import codeql.rust.generated.ConstExpr +/** + * A `const` block expression. For example: + * ``` + * if const { SRC::IS_ZST || DEST::IS_ZST || mem::align_of::() != mem::align_of::() } { + * return false; + * } + * ``` + */ class ConstExpr extends Generated::ConstExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/IfExpr.qll b/rust/ql/lib/codeql/rust/elements/IfExpr.qll index c1500f592c079..ca5886e65673c 100644 --- a/rust/ql/lib/codeql/rust/elements/IfExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/IfExpr.qll @@ -5,4 +5,19 @@ private import codeql.rust.generated.IfExpr +/** + * An `if` expression. For example: + * ``` + * if x == 42 { + * println!("that's the answer"); + * } + * ``` + * ``` + * let y = if x > 0 { + * 1 + * } else { + * 0 + * } + * ``` + */ class IfExpr extends Generated::IfExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/LetExpr.qll b/rust/ql/lib/codeql/rust/elements/LetExpr.qll index 78862471d1bc6..27979b5145405 100644 --- a/rust/ql/lib/codeql/rust/elements/LetExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/LetExpr.qll @@ -5,4 +5,12 @@ private import codeql.rust.generated.LetExpr +/** + * A `let` expression. For example: + * ``` + * if let Some(x) = maybe_some { + * println!("{}", x); + * } + * ``` + */ class LetExpr extends Generated::LetExpr { } diff --git a/rust/ql/lib/codeql/rust/elements/MissingExpr.qll b/rust/ql/lib/codeql/rust/elements/MissingExpr.qll index 3ee2f3a6e4e81..4a9b9806abebd 100644 --- a/rust/ql/lib/codeql/rust/elements/MissingExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/MissingExpr.qll @@ -5,4 +5,11 @@ private import codeql.rust.generated.MissingExpr +/** + * A missing expression, used as a place holder for incomplete syntax, as well as bodies of functions that are defined externally. + * + * ``` + * let x = non_existing_macro!(); + * ``` + */ class MissingExpr extends Generated::MissingExpr { } diff --git a/rust/ql/lib/codeql/rust/generated/AsyncBlockExpr.qll b/rust/ql/lib/codeql/rust/generated/AsyncBlockExpr.qll index 17b7d1b630d66..3d011e059ac97 100644 --- a/rust/ql/lib/codeql/rust/generated/AsyncBlockExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/AsyncBlockExpr.qll @@ -14,6 +14,13 @@ import codeql.rust.elements.BlockExprBase */ module Generated { /** + * An async block expression. For example: + * ``` + * async { + * let x = 42; + * x + * }.await + * ``` * INTERNAL: Do not reference the `Generated::AsyncBlockExpr` class directly. * Use the subclass `AsyncBlockExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/BlockExpr.qll b/rust/ql/lib/codeql/rust/generated/BlockExpr.qll index 52ca4526377d9..d1fbf92c3ab44 100644 --- a/rust/ql/lib/codeql/rust/generated/BlockExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/BlockExpr.qll @@ -15,6 +15,18 @@ import codeql.rust.elements.Label */ module Generated { /** + * A block expression. For example: + * ``` + * { + * let x = 42; + * } + * ``` + * ``` + * 'label: { + * let x = 42; + * x + * } + * ``` * INTERNAL: Do not reference the `Generated::BlockExpr` class directly. * Use the subclass `BlockExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/ConstExpr.qll b/rust/ql/lib/codeql/rust/generated/ConstExpr.qll index 1c11dba419c1a..d237ec3d9d596 100644 --- a/rust/ql/lib/codeql/rust/generated/ConstExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/ConstExpr.qll @@ -14,6 +14,12 @@ import codeql.rust.elements.Expr */ module Generated { /** + * A `const` block expression. For example: + * ``` + * if const { SRC::IS_ZST || DEST::IS_ZST || mem::align_of::() != mem::align_of::() } { + * return false; + * } + * ``` * INTERNAL: Do not reference the `Generated::ConstExpr` class directly. * Use the subclass `ConstExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/IfExpr.qll b/rust/ql/lib/codeql/rust/generated/IfExpr.qll index 4b90ac9b50ace..728ad847fb06a 100644 --- a/rust/ql/lib/codeql/rust/generated/IfExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/IfExpr.qll @@ -14,6 +14,19 @@ import codeql.rust.elements.Expr */ module Generated { /** + * An `if` expression. For example: + * ``` + * if x == 42 { + * println!("that's the answer"); + * } + * ``` + * ``` + * let y = if x > 0 { + * 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/generated/LetExpr.qll b/rust/ql/lib/codeql/rust/generated/LetExpr.qll index a4dccae487607..3608012f30e0b 100644 --- a/rust/ql/lib/codeql/rust/generated/LetExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/LetExpr.qll @@ -15,6 +15,12 @@ import codeql.rust.elements.Pat */ module Generated { /** + * A `let` expression. For example: + * ``` + * if let Some(x) = maybe_some { + * println!("{}", x); + * } + * ``` * INTERNAL: Do not reference the `Generated::LetExpr` class directly. * Use the subclass `LetExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/MissingExpr.qll b/rust/ql/lib/codeql/rust/generated/MissingExpr.qll index 250c639fbeb8e..2b2641f52db32 100644 --- a/rust/ql/lib/codeql/rust/generated/MissingExpr.qll +++ b/rust/ql/lib/codeql/rust/generated/MissingExpr.qll @@ -14,6 +14,11 @@ import codeql.rust.elements.Expr */ module Generated { /** + * A missing expression, used as a place holder for incomplete syntax, as well as bodies of functions that are defined externally. + * + * ``` + * let x = non_existing_macro!(); + * ``` * INTERNAL: Do not reference the `Generated::MissingExpr` class directly. * Use the subclass `MissingExpr`, where the following predicates are available. */ diff --git a/rust/ql/lib/codeql/rust/generated/Raw.qll b/rust/ql/lib/codeql/rust/generated/Raw.qll index 28531dfe4a0bf..eae6b23a1080f 100644 --- a/rust/ql/lib/codeql/rust/generated/Raw.qll +++ b/rust/ql/lib/codeql/rust/generated/Raw.qll @@ -395,6 +395,12 @@ module Raw { /** * INTERNAL: Do not use. + * A `const` block expression. For example: + * ``` + * if const { SRC::IS_ZST || DEST::IS_ZST || mem::align_of::() != mem::align_of::() } { + * return false; + * } + * ``` */ class ConstExpr extends @const_expr, Expr { override string toString() { result = "ConstExpr" } @@ -480,6 +486,19 @@ module Raw { /** * INTERNAL: Do not use. + * An `if` expression. For example: + * ``` + * if x == 42 { + * println!("that's the answer"); + * } + * ``` + * ``` + * let y = if x > 0 { + * 1 + * } else { + * 0 + * } + * ``` */ class IfExpr extends @if_expr, Expr { override string toString() { result = "IfExpr" } @@ -543,6 +562,12 @@ module Raw { /** * INTERNAL: Do not use. + * A `let` expression. For example: + * ``` + * if let Some(x) = maybe_some { + * println!("{}", x); + * } + * ``` */ class LetExpr extends @let_expr, Expr { override string toString() { result = "LetExpr" } @@ -667,6 +692,11 @@ module Raw { /** * INTERNAL: Do not use. + * A missing expression, used as a place holder for incomplete syntax, as well as bodies of functions that are defined externally. + * + * ``` + * let x = non_existing_macro!(); + * ``` */ class MissingExpr extends @missing_expr, Expr { override string toString() { result = "MissingExpr" } @@ -1023,6 +1053,13 @@ module Raw { /** * INTERNAL: Do not use. + * An async block expression. For example: + * ``` + * async { + * let x = 42; + * x + * }.await + * ``` */ class AsyncBlockExpr extends @async_block_expr, BlockExprBase { override string toString() { result = "AsyncBlockExpr" } @@ -1030,6 +1067,18 @@ module Raw { /** * INTERNAL: Do not use. + * A block expression. For example: + * ``` + * { + * let x = 42; + * } + * ``` + * ``` + * 'label: { + * let x = 42; + * x + * } + * ``` */ class BlockExpr extends @block_expr, BlockExprBase { override string toString() { result = "BlockExpr" } diff --git a/rust/ql/test/extractor-tests/generated/.generated_tests.list b/rust/ql/test/extractor-tests/generated/.generated_tests.list index aca5873c82078..1df9beb7f0c06 100644 --- a/rust/ql/test/extractor-tests/generated/.generated_tests.list +++ b/rust/ql/test/extractor-tests/generated/.generated_tests.list @@ -1 +1,7 @@ +AsyncBlockExpr/gen_async_block_expr.rs 63b31fbeeead710902aa31184c06e88e604a1b7ff3308aba52b5d6a965870ff6 63b31fbeeead710902aa31184c06e88e604a1b7ff3308aba52b5d6a965870ff6 +BlockExpr/gen_block_expr.rs b09aa0406d2e772bc14bb1be4959ac21ebaf75c65a1d9f92bb3d8be5fd571023 b09aa0406d2e772bc14bb1be4959ac21ebaf75c65a1d9f92bb3d8be5fd571023 +ConstExpr/gen_const_expr.rs 04a1e4620c843101bfccd38027af68390817dbb750c203250f4fcc208af0d26b 04a1e4620c843101bfccd38027af68390817dbb750c203250f4fcc208af0d26b Function/gen_function.rs 4be46d4798cd32b51e449d1b6c4bc7461216a8a0e765b61abac21354401a7776 4be46d4798cd32b51e449d1b6c4bc7461216a8a0e765b61abac21354401a7776 +IfExpr/gen_if_expr.rs 073ba575b54a553945d3131d7e92cdb1520c24f380361723a1b9d848b6296d7b 073ba575b54a553945d3131d7e92cdb1520c24f380361723a1b9d848b6296d7b +LetExpr/gen_let_expr.rs 83e9726f3f14fb9d3d332462230fc939f0214216997f5ca84f58518ffd65653d 83e9726f3f14fb9d3d332462230fc939f0214216997f5ca84f58518ffd65653d +MissingExpr/gen_missing_expr.rs 8e32068d7db05b0bd02ce7087e36e7dafbbc5edd1cd40fc98cf47a68e20b1746 8e32068d7db05b0bd02ce7087e36e7dafbbc5edd1cd40fc98cf47a68e20b1746 diff --git a/rust/ql/test/extractor-tests/generated/.gitattributes b/rust/ql/test/extractor-tests/generated/.gitattributes index 2ca6c13705381..8edf48ed1fab5 100644 --- a/rust/ql/test/extractor-tests/generated/.gitattributes +++ b/rust/ql/test/extractor-tests/generated/.gitattributes @@ -1,3 +1,9 @@ /.generated_tests.list linguist-generated /.gitattributes linguist-generated +/AsyncBlockExpr/gen_async_block_expr.rs linguist-generated +/BlockExpr/gen_block_expr.rs linguist-generated +/ConstExpr/gen_const_expr.rs linguist-generated /Function/gen_function.rs linguist-generated +/IfExpr/gen_if_expr.rs linguist-generated +/LetExpr/gen_let_expr.rs linguist-generated +/MissingExpr/gen_missing_expr.rs linguist-generated diff --git a/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr.expected b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr.expected new file mode 100644 index 0000000000000..1cd82381fb4fd --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr.expected @@ -0,0 +1 @@ +| gen_async_block_expr.rs:5:5:8:5 | AsyncBlockExpr | getNumberOfStatements: | 1 | hasTail: | yes | diff --git a/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr.ql b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr.ql new file mode 100644 index 0000000000000..132be12a64f45 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from AsyncBlockExpr x, int getNumberOfStatements, string hasTail +where + toBeTested(x) and + not x.isUnknown() and + getNumberOfStatements = x.getNumberOfStatements() and + if x.hasTail() then hasTail = "yes" else hasTail = "no" +select x, "getNumberOfStatements:", getNumberOfStatements, "hasTail:", hasTail diff --git a/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getStatement.expected b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getStatement.expected new file mode 100644 index 0000000000000..d9c3f9a68979e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getStatement.expected @@ -0,0 +1 @@ +| gen_async_block_expr.rs:5:5:8:5 | AsyncBlockExpr | 0 | gen_async_block_expr.rs:6:12:6:12 | LetStmt | diff --git a/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getStatement.ql b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getStatement.ql new file mode 100644 index 0000000000000..84e5c344a6f4d --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getStatement.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from AsyncBlockExpr x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getStatement(index) diff --git a/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getTail.expected b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getTail.expected new file mode 100644 index 0000000000000..66ead87e31223 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getTail.expected @@ -0,0 +1 @@ +| gen_async_block_expr.rs:5:5:8:5 | AsyncBlockExpr | gen_async_block_expr.rs:7:8:7:8 | PathExpr | diff --git a/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getTail.ql b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getTail.ql new file mode 100644 index 0000000000000..574c7fa720341 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/AsyncBlockExpr_getTail.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from AsyncBlockExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getTail() diff --git a/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/gen_async_block_expr.rs b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/gen_async_block_expr.rs new file mode 100644 index 0000000000000..fec15de4176e6 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/AsyncBlockExpr/gen_async_block_expr.rs @@ -0,0 +1,9 @@ +// generated by codegen + +fn test_async_block_expr() -> i32 { + // An async block expression. For example: + async { + let x = 42; + x + }.await +} diff --git a/rust/ql/test/extractor-tests/generated/Expr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/AwaitExpr/MISSING_SOURCE.txt similarity index 100% rename from rust/ql/test/extractor-tests/generated/Expr/MISSING_SOURCE.txt rename to rust/ql/test/extractor-tests/generated/AwaitExpr/MISSING_SOURCE.txt diff --git a/rust/ql/test/extractor-tests/generated/BecomeExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/BecomeExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BecomeExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/BinaryOpExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/BinaryOpExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BinaryOpExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.expected b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.expected new file mode 100644 index 0000000000000..348f98b730ba9 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.expected @@ -0,0 +1,3 @@ +| gen_block_expr.rs:3:28:12:1 | BlockExpr | getNumberOfStatements: | 1 | hasTail: | yes | hasLabel: | no | +| gen_block_expr.rs:5:5:7:5 | BlockExpr | getNumberOfStatements: | 1 | hasTail: | no | hasLabel: | no | +| gen_block_expr.rs:8:5:11:5 | BlockExpr | getNumberOfStatements: | 1 | hasTail: | yes | hasLabel: | yes | diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.ql b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.ql new file mode 100644 index 0000000000000..d0c3e4e3e6dbf --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.ql @@ -0,0 +1,13 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from BlockExpr x, int getNumberOfStatements, string hasTail, string hasLabel +where + toBeTested(x) and + not x.isUnknown() and + getNumberOfStatements = x.getNumberOfStatements() and + (if x.hasTail() then hasTail = "yes" else hasTail = "no") and + if x.hasLabel() then hasLabel = "yes" else hasLabel = "no" +select x, "getNumberOfStatements:", getNumberOfStatements, "hasTail:", hasTail, "hasLabel:", + hasLabel diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.expected b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.expected new file mode 100644 index 0000000000000..3a935228e0511 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.expected @@ -0,0 +1 @@ +| gen_block_expr.rs:8:5:11:5 | BlockExpr | gen_block_expr.rs:8:5:8:11 | Label | diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.ql b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.ql new file mode 100644 index 0000000000000..dcc97bc9a4856 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from BlockExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getLabel() diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getStatement.expected b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getStatement.expected new file mode 100644 index 0000000000000..66dc93e503df0 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getStatement.expected @@ -0,0 +1,3 @@ +| gen_block_expr.rs:3:28:12:1 | BlockExpr | 0 | gen_block_expr.rs:5:5:7:5 | ExprStmt | +| gen_block_expr.rs:5:5:7:5 | BlockExpr | 0 | gen_block_expr.rs:6:13:6:13 | LetStmt | +| gen_block_expr.rs:8:5:11:5 | BlockExpr | 0 | gen_block_expr.rs:9:13:9:13 | LetStmt | diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getStatement.ql b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getStatement.ql new file mode 100644 index 0000000000000..22c05e398d0a4 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getStatement.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from BlockExpr x, int index +where toBeTested(x) and not x.isUnknown() +select x, index, x.getStatement(index) diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getTail.expected b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getTail.expected new file mode 100644 index 0000000000000..2a3d8031821cd --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getTail.expected @@ -0,0 +1,2 @@ +| gen_block_expr.rs:3:28:12:1 | BlockExpr | gen_block_expr.rs:8:5:11:5 | BlockExpr | +| gen_block_expr.rs:8:5:11:5 | BlockExpr | gen_block_expr.rs:10:9:10:9 | PathExpr | diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getTail.ql b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getTail.ql new file mode 100644 index 0000000000000..f86117be4b9d6 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr_getTail.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from BlockExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getTail() diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/gen_block_expr.rs b/rust/ql/test/extractor-tests/generated/BlockExpr/gen_block_expr.rs new file mode 100644 index 0000000000000..9ccff26f1aae6 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/gen_block_expr.rs @@ -0,0 +1,12 @@ +// generated by codegen + +fn test_block_expr() -> () { + // A block expression. For example: + { + let x = 42; + } + 'label: { + let x = 42; + x + } +} diff --git a/rust/ql/test/extractor-tests/generated/BoxExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/BoxExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BoxExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/BreakExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/CallExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/CallExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/CallExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/CastExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/CastExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/CastExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/ClosureExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/ClosureExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ClosureExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/ConstExpr/ConstExpr.expected b/rust/ql/test/extractor-tests/generated/ConstExpr/ConstExpr.expected new file mode 100644 index 0000000000000..b36d974f77349 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ConstExpr/ConstExpr.expected @@ -0,0 +1 @@ +| gen_const_expr.rs:5:8:5:97 | ConstExpr | getExpr: | gen_const_expr.rs:5:8:5:97 | BlockExpr | diff --git a/rust/ql/test/extractor-tests/generated/ConstExpr/ConstExpr.ql b/rust/ql/test/extractor-tests/generated/ConstExpr/ConstExpr.ql new file mode 100644 index 0000000000000..700a5c7040225 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ConstExpr/ConstExpr.ql @@ -0,0 +1,10 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from ConstExpr x, Expr getExpr +where + toBeTested(x) and + not x.isUnknown() and + getExpr = x.getExpr() +select x, "getExpr:", getExpr diff --git a/rust/ql/test/extractor-tests/generated/ConstExpr/gen_const_expr.rs b/rust/ql/test/extractor-tests/generated/ConstExpr/gen_const_expr.rs new file mode 100644 index 0000000000000..c9e3e35509069 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ConstExpr/gen_const_expr.rs @@ -0,0 +1,8 @@ +// generated by codegen + +fn test_const_expr() -> bool { + // A `const` block expression. For example: + if const { SRC::IS_ZST || DEST::IS_ZST || mem::align_of::() != mem::align_of::() } { + return false; + } +} diff --git a/rust/ql/test/extractor-tests/generated/ContinueExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/ContinueExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ContinueExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/ElementListExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/ElementListExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ElementListExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/FieldExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/FieldExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/FieldExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/Function/Function.expected b/rust/ql/test/extractor-tests/generated/Function/Function.expected index 1d34bccc1c62b..453a2db17934b 100644 --- a/rust/ql/test/extractor-tests/generated/Function/Function.expected +++ b/rust/ql/test/extractor-tests/generated/Function/Function.expected @@ -1 +1 @@ -| gen_function.rs:2:0:3:40 | foo | getName: | foo | getBody: | file://:0:0:0:0 | (no string representation) | +| gen_function.rs:3:1:4:40 | foo | getName: | foo | getBody: | gen_function.rs:4:23:4:40 | BlockExpr | diff --git a/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr.expected b/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr.expected new file mode 100644 index 0000000000000..fc99c3eae67c5 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr.expected @@ -0,0 +1,2 @@ +| gen_if_expr.rs:5:5:7:5 | IfExpr | getCondition: | gen_if_expr.rs:5:8:5:14 | BinaryOpExpr | getThen: | gen_if_expr.rs:5:16:7:5 | BlockExpr | hasElse: | no | +| gen_if_expr.rs:8:13:12:5 | IfExpr | getCondition: | gen_if_expr.rs:8:16:8:20 | BinaryOpExpr | getThen: | gen_if_expr.rs:8:22:10:5 | BlockExpr | hasElse: | yes | diff --git a/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr.ql b/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr.ql new file mode 100644 index 0000000000000..a684dcd54341a --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr.ql @@ -0,0 +1,12 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from IfExpr x, Expr getCondition, Expr getThen, string hasElse +where + toBeTested(x) and + not x.isUnknown() and + getCondition = x.getCondition() and + getThen = x.getThen() and + if x.hasElse() then hasElse = "yes" else hasElse = "no" +select x, "getCondition:", getCondition, "getThen:", getThen, "hasElse:", hasElse diff --git a/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr_getElse.expected b/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr_getElse.expected new file mode 100644 index 0000000000000..a857dbe2099a3 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr_getElse.expected @@ -0,0 +1 @@ +| gen_if_expr.rs:8:13:12:5 | IfExpr | gen_if_expr.rs:10:12:12:5 | BlockExpr | diff --git a/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr_getElse.ql b/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr_getElse.ql new file mode 100644 index 0000000000000..8e6209a248c10 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IfExpr/IfExpr_getElse.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from IfExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getElse() 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 new file mode 100644 index 0000000000000..6ef2659892bcb --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IfExpr/gen_if_expr.rs @@ -0,0 +1,13 @@ +// generated by codegen + +fn test_if_expr() -> () { + // An `if` expression. For example: + if x == 42 { + println!("that's the answer"); + } + let y = if x > 0 { + 1 + } else { + 0 + } +} diff --git a/rust/ql/test/extractor-tests/generated/IndexExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/IndexExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/IndexExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/InlineAsmExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/InlineAsmExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/InlineAsmExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/LetExpr/LetExpr.expected b/rust/ql/test/extractor-tests/generated/LetExpr/LetExpr.expected new file mode 100644 index 0000000000000..41d358886f42e --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LetExpr/LetExpr.expected @@ -0,0 +1 @@ +| gen_let_expr.rs:5:8:5:31 | LetExpr | getPat: | gen_let_expr.rs:5:12:5:18 | TupleStructPat | getExpr: | gen_let_expr.rs:5:22:5:31 | PathExpr | diff --git a/rust/ql/test/extractor-tests/generated/LetExpr/LetExpr.ql b/rust/ql/test/extractor-tests/generated/LetExpr/LetExpr.ql new file mode 100644 index 0000000000000..bcb2e11126783 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LetExpr/LetExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from LetExpr x, Pat getPat, Expr getExpr +where + toBeTested(x) and + not x.isUnknown() and + getPat = x.getPat() and + getExpr = x.getExpr() +select x, "getPat:", getPat, "getExpr:", getExpr diff --git a/rust/ql/test/extractor-tests/generated/LetExpr/gen_let_expr.rs b/rust/ql/test/extractor-tests/generated/LetExpr/gen_let_expr.rs new file mode 100644 index 0000000000000..1a8bab21c4fe5 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LetExpr/gen_let_expr.rs @@ -0,0 +1,8 @@ +// generated by codegen + +fn test_let_expr(maybe_some: Option) -> () { + // A `let` expression. For example: + if let Some(x) = maybe_some { + println!("{}", x); + } +} diff --git a/rust/ql/test/extractor-tests/generated/LiteralExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/LiteralExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LiteralExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/LoopExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/LoopExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/LoopExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/MatchExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/MatchExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MatchExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/MethodCallExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/MethodCallExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MethodCallExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/MissingExpr/MissingExpr.expected b/rust/ql/test/extractor-tests/generated/MissingExpr/MissingExpr.expected new file mode 100644 index 0000000000000..bd096b3f48804 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MissingExpr/MissingExpr.expected @@ -0,0 +1 @@ +| gen_missing_expr.rs:6:13:6:33 | MissingExpr | diff --git a/rust/ql/test/extractor-tests/generated/MissingExpr/MissingExpr.ql b/rust/ql/test/extractor-tests/generated/MissingExpr/MissingExpr.ql new file mode 100644 index 0000000000000..eb4a28543c747 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MissingExpr/MissingExpr.ql @@ -0,0 +1,7 @@ +// generated by codegen +import codeql.rust.elements +import TestUtils + +from MissingExpr x +where toBeTested(x) and not x.isUnknown() +select x diff --git a/rust/ql/test/extractor-tests/generated/MissingExpr/gen_missing_expr.rs b/rust/ql/test/extractor-tests/generated/MissingExpr/gen_missing_expr.rs new file mode 100644 index 0000000000000..e4fd065c36452 --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/MissingExpr/gen_missing_expr.rs @@ -0,0 +1,7 @@ +// generated by codegen + +fn test_missing_expr() -> () { + // A missing expression, used as a place holder for incomplete syntax, as well as bodies of functions that are defined externally. + // + let x = non_existing_macro!(); +} diff --git a/rust/ql/test/extractor-tests/generated/OffsetOfExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/OffsetOfExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/OffsetOfExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/PathExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/PathExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/PathExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/RangeExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/RangeExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RangeExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/RecordLitExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/RecordLitExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RecordLitExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/RefExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/RefExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RefExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/RepeatExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/RepeatExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/RepeatExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/ReturnExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/ReturnExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/ReturnExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/TupleExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/TupleExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/TupleExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/UnaryOpExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/UnaryOpExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/UnaryOpExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/UnderscoreExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/UnderscoreExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/UnderscoreExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/UnsafeBlockExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/YeetExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/YeetExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/YeetExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/ql/test/extractor-tests/generated/YieldExpr/MISSING_SOURCE.txt b/rust/ql/test/extractor-tests/generated/YieldExpr/MISSING_SOURCE.txt new file mode 100644 index 0000000000000..9cb54ddd059ea --- /dev/null +++ b/rust/ql/test/extractor-tests/generated/YieldExpr/MISSING_SOURCE.txt @@ -0,0 +1,4 @@ +// generated by codegen + +After a source file is added in this directory and codegen is run again, test queries +will appear and this file will be deleted diff --git a/rust/schema.py b/rust/schema.py index 1a5a19b2e0b83..59f82cf84fcd1 100644 --- a/rust/schema.py +++ b/rust/schema.py @@ -76,7 +76,6 @@ class Module(Declaration): declarations: list[Declaration] | child -@qltest.collapse_hierarchy class Expr(AstNode): pass @@ -119,8 +118,15 @@ class Function(Declaration): body: Expr | child -# Missing, +@rust.doc_test_signature("() -> ()") class MissingExpr(Expr): + """ + A missing expression, used as a place holder for incomplete syntax, as well as bodies of functions that are defined externally. + + ``` + let x = non_existing_macro!(); + ``` + """ pass @@ -137,7 +143,23 @@ class PathExpr(Expr): # }, +@rust.doc_test_signature("() -> ()") class IfExpr(Expr): + """ + An `if` expression. For example: + ``` + if x == 42 { + println!("that's the answer"); + } + ``` + ``` + let y = if x > 0 { + 1 + } else { + 0 + } + ``` + """ condition: Expr | child then: Expr | child else_: optional[Expr] | child @@ -148,7 +170,16 @@ class IfExpr(Expr): # }, +@rust.doc_test_signature("(maybe_some: Option) -> ()") class LetExpr(Expr): + """ + A `let` expression. For example: + ``` + if let Some(x) = maybe_some { + println!("{}", x); + } + ``` + """ pat: Pat | child expr: Expr | child @@ -165,7 +196,22 @@ class BlockExprBase(Expr): tail: optional[Expr] | child +@rust.doc_test_signature("() -> ()") class BlockExpr(BlockExprBase): + """ + A block expression. For example: + ``` + { + let x = 42; + } + ``` + ``` + 'label: { + let x = 42; + x + } + ``` + """ label: optional[Label] | child # Async { @@ -175,13 +221,30 @@ class BlockExpr(BlockExprBase): # }, +@rust.doc_test_signature("() -> i32") class AsyncBlockExpr(BlockExprBase): + """ + An async block expression. For example: + ``` + async { + let x = 42; + x + }.await + ``` + """ pass -# Const(ConstBlockId), - +@rust.doc_test_signature("() -> bool") class ConstExpr(Expr): + """ + A `const` block expression. For example: + ``` + if const { SRC::IS_ZST || DEST::IS_ZST || mem::align_of::() != mem::align_of::() } { + return false; + } + ``` + """ expr: Expr | child # // FIXME: Fold this into Block with an unsafe flag?