diff --git a/rust/extractor/src/generated/.generated.list b/rust/extractor/src/generated/.generated.list index 886def53f2d..e354f7a6efd 100644 --- a/rust/extractor/src/generated/.generated.list +++ b/rust/extractor/src/generated/.generated.list @@ -1,2 +1,2 @@ mod.rs 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 -top.rs 7269710572ed5f727107f19cf4002ec19b8a4149842b351c6c61dbeb1ec35e5c 7269710572ed5f727107f19cf4002ec19b8a4149842b351c6c61dbeb1ec35e5c +top.rs 6cb5c672cc7e8f2f3870c7d8b36714bfb42148fd94a097458d0011e135ea899a 6cb5c672cc7e8f2f3870c7d8b36714bfb42148fd94a097458d0011e135ea899a diff --git a/rust/extractor/src/generated/top.rs b/rust/extractor/src/generated/top.rs index fad605cab2e..50db26e14a3 100644 --- a/rust/extractor/src/generated/top.rs +++ b/rust/extractor/src/generated/top.rs @@ -3614,6 +3614,51 @@ impl From> for trap::Label { } } +#[derive(Debug)] +pub struct CallExprBase { + _unused: () +} + +impl trap::TrapClass for CallExprBase { + fn class_name() -> &'static str { "CallExprBase" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme CallExprBase is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme CallExprBase is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme CallExprBase is a subclass of Expr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme CallExprBase is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + #[derive(Debug)] pub struct CastExpr { pub id: trap::TrapId, @@ -4522,51 +4567,6 @@ impl From> for trap::Label { } } -#[derive(Debug)] -pub struct FunctionOrMethodCallExpr { - _unused: () -} - -impl trap::TrapClass for FunctionOrMethodCallExpr { - fn class_name() -> &'static str { "FunctionOrMethodCallExpr" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme FunctionOrMethodCallExpr is a subclass of AstNode - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme FunctionOrMethodCallExpr is a subclass of Element - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme FunctionOrMethodCallExpr is a subclass of Expr - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme FunctionOrMethodCallExpr is a subclass of Locatable - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - #[derive(Debug)] pub struct IdentPat { pub id: trap::TrapId, @@ -7872,10 +7872,10 @@ impl trap::TrapEntry for CallExpr { fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("call_exprs", vec![id.into()]); if let Some(v) = self.arg_list { - out.add_tuple("function_or_method_call_expr_arg_lists", vec![id.into(), v.into()]); + out.add_tuple("call_expr_base_arg_lists", vec![id.into(), v.into()]); } for (i, v) in self.attrs.into_iter().enumerate() { - out.add_tuple("function_or_method_call_expr_attrs", vec![id.into(), i.into(), v.into()]); + out.add_tuple("call_expr_base_attrs", vec![id.into(), i.into(), v.into()]); } if let Some(v) = self.expr { out.add_tuple("call_expr_exprs", vec![id.into(), v.into()]); @@ -7896,6 +7896,15 @@ impl From> for trap::Label { } } +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme CallExpr is a subclass of CallExprBase + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme CallExpr is a subclass of Element @@ -7914,15 +7923,6 @@ impl From> for trap::Label { } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme CallExpr is a subclass of FunctionOrMethodCallExpr - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme CallExpr is a subclass of Locatable @@ -8755,10 +8755,10 @@ impl trap::TrapEntry for MethodCallExpr { fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("method_call_exprs", vec![id.into()]); if let Some(v) = self.arg_list { - out.add_tuple("function_or_method_call_expr_arg_lists", vec![id.into(), v.into()]); + out.add_tuple("call_expr_base_arg_lists", vec![id.into(), v.into()]); } for (i, v) in self.attrs.into_iter().enumerate() { - out.add_tuple("function_or_method_call_expr_attrs", vec![id.into(), i.into(), v.into()]); + out.add_tuple("call_expr_base_attrs", vec![id.into(), i.into(), v.into()]); } if let Some(v) = self.generic_arg_list { out.add_tuple("method_call_expr_generic_arg_lists", vec![id.into(), v.into()]); @@ -8785,6 +8785,15 @@ impl From> for trap::Label { } } +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme MethodCallExpr is a subclass of CallExprBase + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme MethodCallExpr is a subclass of Element @@ -8803,15 +8812,6 @@ impl From> for trap::Label { } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme MethodCallExpr is a subclass of FunctionOrMethodCallExpr - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - impl From> for trap::Label { fn from(value: trap::Label) -> Self { // SAFETY: this is safe because in the dbscheme MethodCallExpr is a subclass of Locatable diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index 59d71c49663..9cc24f2efe6 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -14,7 +14,8 @@ lib/codeql/rust/elements/BinaryExpr.qll 394522da3bc3a716fc7bc40c3560143ca840f5d2 lib/codeql/rust/elements/BlockExpr.qll b952fd44b89de248931d4089834d2c9406f6f2fc1a3f5c2365156be4e55157cf daccc07ab11ac696679b9fadc99f40b1bf579c90bf6c7cca6e82eaa313932ede lib/codeql/rust/elements/BoxPat.qll 1b2c3fff171aa6aa238c9460b122f26c79e04577cea67fa856de99842ba873d4 0caf8d23ed6e0997a6b8751def27641582151fba6e24fccf798712a4690b42f1 lib/codeql/rust/elements/BreakExpr.qll 7ca3807a20e9a9a988d1fd7abebf240325ed422fcb45c719ba46272f031f94db dffb7379d3f3ba220acfbd05eb7bb6cfd9cfda211e9c8b1f5240ca5fa61be3fc -lib/codeql/rust/elements/CallExpr.qll 4232f42c54212fe9e8aa140194da324b77581395a4d5c899190d469609598668 a589e19792174b18ce39b74e19828bfe5c7ff796424c05f6a6084eab4ff16ab4 +lib/codeql/rust/elements/CallExpr.qll f336500ca7a611b164d48b90e80edb0c0d3816792b0ececce659ac1ff1ffeb3e f99a9c55466418ef53860c44d9f2d6161af4b492178ddd9e5870dff742b70ae5 +lib/codeql/rust/elements/CallExprBase.qll 2846202b5208b541977500286951d96487bf555838c6c16cdd006a71e383745a c789d412bf099c624329379e0c7d94fa0d23ae2edea7a25a2ea0f3c0042ccf62 lib/codeql/rust/elements/CastExpr.qll ba281bde130f43c486c4ad889539b77fba9e41afdf7980e50b6a8696a1ec7527 61257003d395896ec60729d0bc01da36697615bb725d07141255fbb5c44e50a0 lib/codeql/rust/elements/ClosureBinder.qll 977df800f97cc9b03fffb5e5e1fc6acd08a2938e04cb6ad91108784a15b0d510 f6fad4127226fe1dff2f16416d8a7fde5d8ab4a88f30e443ac5e5ff618de3e05 lib/codeql/rust/elements/ClosureExpr.qll 8f06357ae134e42c073eef994c83c04b8cf294fe33b286dbd75c0e705ce29d05 9d9e282d965fed723965376801d4afa49444d1d9be9b093d02e276729a2cf7ad @@ -41,7 +42,6 @@ lib/codeql/rust/elements/ForType.qll 0036bed8749358c356d78c4a0eef40d73e279628429 lib/codeql/rust/elements/FormatArgsArg.qll 5bc9b4cd1bac7131165836e93838c45452a08ea6011741cbddace3cbf9c69440 f825140e98dc9800d5c045402186793c7b21511448e2f6bf6402d1e06305219c lib/codeql/rust/elements/FormatArgsExpr.qll f2ffad5a1105b29a8437c8ed6cf918cfcf4d65ac164bbf1be0585c3b673ca749 3ba20dc312a0a994bb43b37b2db72cbd4e06061b97918fa0e84ce355070ffbeb lib/codeql/rust/elements/Function.qll 736c53408f8674c88c352cd1f08f7c77e51551c68ef802f2e1c1aaf3d44fa8e9 6b52dbea081a5e799f1a2cedd57be5485bc8e018ded7249a1852343053d849a6 -lib/codeql/rust/elements/FunctionOrMethodCallExpr.qll 69754853bd452c18a333e2bb70a401726cc115092a120662edac5b24586f1951 1d9226ea609d298ec76eaf6a25248c96315b14a5993ac7c8dfd7fd80e1c134fb lib/codeql/rust/elements/GenericArg.qll 5f11ce0e3c5f08de84db61f56ba1b984652455ba6b95a8b8a5b5a235913d4072 756b6a73d66fde45bdcc65ce2362a5b1391af2927e6d54b6550b3ecd5fd11e75 lib/codeql/rust/elements/GenericArgList.qll dcf274db517b0e8f19e4545d77f86cdd4066ff2805e68c808d0bb5750b49f569 1055a82929e850264e501b367ef4d314a3e6bb8943ec95f4284d157fb4d0092f lib/codeql/rust/elements/GenericParam.qll b58448b808d6dfa05db9574f54c22ce51f0b1d78784263c75a95d6bfc787067d 4afbab71fe717d7d7d3e2f60ea8c3d97bcb29b17b4efb79eabfe8f070edcb9bb @@ -76,7 +76,7 @@ lib/codeql/rust/elements/MatchArmList.qll e6c48fd7419d88e996b82eb45e4aa2686dfd07 lib/codeql/rust/elements/MatchExpr.qll e9ef1664f020823b6f4bb72d906a9dc0c1ee6432d4a9a13f7dbdbab2b2b1ee4d 38d71e5c487abcb5682293c573343be66e499a6e131bb630604c120d34b7777b lib/codeql/rust/elements/MatchGuard.qll 20754ab2009a7d40b50feece496ff7f38650586d79190ed2a372308594693694 471f8f118317efcf112f4ddfd60125ca2a9d9b3b08e6ee331c430961de7885ff lib/codeql/rust/elements/Meta.qll 9fa3216c86fa55ed5c0c4671708110a6ffc7c0f5d6cda8dda31aaff17f87534d c44ee2754dd71776ffd0a8a7d6c1ae8737c47e998e6bdb8efab5283625807cf4 -lib/codeql/rust/elements/MethodCallExpr.qll d19c02fdd2f6f649dfbf757c53f4af441f10842ca69f56b13d218e343961688b eafb571244dcbec1bb8106f8ec03c641ca383b51b615506bf0d7bc90a1aa1934 +lib/codeql/rust/elements/MethodCallExpr.qll 91b411e0fb1a0547dcad8726db460dccc61bed972741598d5cb3740593fe75a7 538d23b6db115bb699389d29a1829bb0449c08424a1fff80377828eb7ceb2563 lib/codeql/rust/elements/Missing.qll 70e6ac9790314752849c9888443c98223ccfc93a193998b7ce350b2c6ebe8ea4 e2f0623511acaa76b091f748d417714137a8b94f1f2bdbbd177f1c682c786dad lib/codeql/rust/elements/Module.qll 0bc85019177709256f8078d9de2a36f62f848d476225bff7bba1e35f249875c7 3fbb70e0c417a644dd0cada2c364c6e6876cfa16f37960e219c87e49c966c94e lib/codeql/rust/elements/Name.qll 3d7ed16c232912e30e5a075f5087ad344a8f76dcc27bc8f71a80c133802b89d7 036dc3ba0c20eb0907ef6dcc532214aa5de8e0de0fa819eca1fce0355b3741a3 @@ -184,6 +184,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/CallExprBaseImpl.qll d2749cc1a9d7ee8bf7f34b6c3e0238a576a68e439a8c10a503c164ff45ffcbeb ffc7b0a8841945fe6736b0e1aed7d9ed69185db03dee2b16da121325b39397c7 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 @@ -230,7 +231,6 @@ lib/codeql/rust/elements/internal/FormatArgsArgImpl.qll 601f7715e9a65bcfa7cea197 lib/codeql/rust/elements/internal/FormatArgsExprConstructor.qll ce29ff5a839b885b1ab7a02d6a381ae474ab1be3e6ee7dcfd7595bdf28e4b558 63bf957426871905a51ea319662a59e38104c197a1024360aca364dc145b11e8 lib/codeql/rust/elements/internal/FormatArgsExprImpl.qll bdb992ebc6be59311b486f40325b39f52a69921cfc66a731085cb184da00050f 6336e7770f9cb700f1b3914fd940c3423ab4e971b34ed8fcc79da80c1f1cdba3 lib/codeql/rust/elements/internal/FunctionConstructor.qll b50aea579938d03745dfbd8b5fa8498f7f83b967369f63d6875510e09ab7f5d2 19cca32aeaecaf9debc27329e8c39ecec69464bb1d89d7b09908a1d73a8d92a2 -lib/codeql/rust/elements/internal/FunctionOrMethodCallExprImpl.qll 34e7b5c95c8f0fdbd9c52159494e21046acbd0d62e1fb9b2eee53a11f15be261 105783845539bc44f05473efe8bedbc033fb5fb107c2daa77af664bfccb20bf6 lib/codeql/rust/elements/internal/GenericArgImpl.qll 6b1b804c357425c223f926e560a688e81506f5a35b95485cecf704e88cc009ee cc1ccf6a23dadc397e82664f3911d4b385d4c8ca80b1ee16d5275d9c936148dd lib/codeql/rust/elements/internal/GenericArgListConstructor.qll 46859bb3eb09d77987a18642d65ba2e13471a4dc9c0a83a192fddc82e37c335c 2c7d54c876269a88d3461b05745e73b06532b1616cae9b614ac94b28735d8fc4 lib/codeql/rust/elements/internal/GenericArgListImpl.qll 1a39ba7080147abccaaba451852c9c124fb6177f2ebd64e38ee74014444a34e1 80df3150c961936037ac02b46ef5f775c3f82e66490afbca00a016cb9eee798a @@ -461,7 +461,8 @@ lib/codeql/rust/elements/internal/generated/BinaryExpr.qll 64e9bd9c571edd6e5f3e7 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 0f428a8b2f4209b134c2ffc3e1c93c30bc6b0e9c9172f140cefa88c1f77d8690 957b39f38ff6befe9061f55bc0b403c2f1c366dd0cf63b874bae6f8216576d76 -lib/codeql/rust/elements/internal/generated/CallExpr.qll 2ed74ea3da426b351949291ae728eb6d70de033cccc667712988cf416319e999 af84a17bf5512dc97d8781cb0aa868c7f5349932596f2600785d2432e15ece3a +lib/codeql/rust/elements/internal/generated/CallExpr.qll 23ee64e3bf643cd5e6ff705181d2bb31e1aeaffecb5bdce73836172dbf15f12f 34b280139b1f8f70d78e1432392f03c971be392e8cb68d014eb325d0c101bddd +lib/codeql/rust/elements/internal/generated/CallExprBase.qll cce796e36847249f416629bacf3ea146313084de3374587412e66c10d2917b83 c219aa2174321c161a4a742ca0605521687ca9a5ca32db453a5c62db6f7784cc lib/codeql/rust/elements/internal/generated/CastExpr.qll d6fbf02e9e202254666082a9116634d0eb933177866ac4c0a57b5e9c4bb4b383 477f67773492e3b82695461d56327c9db05a7d1a67e8d192406265f2ce369670 lib/codeql/rust/elements/internal/generated/ClosureBinder.qll 94c0dcdd4cd87d115659d496c88a98354bc7d4ddc0fa27028003bf7688b99987 d59d713b426dbbdb775df9092d176eea031dac1f14e468810f2fc8591399cd19 lib/codeql/rust/elements/internal/generated/ClosureExpr.qll f9047451cb8b53f8b77e1c01f7ef485d5b5a92999e0591c6702062050052fa2f 2252be8b3022c587a8c6ad93b64d856263be7bfe2938c1d063e7cad845dd38e2 @@ -488,7 +489,6 @@ lib/codeql/rust/elements/internal/generated/ForType.qll 3d43d044a1189281f09c55ca lib/codeql/rust/elements/internal/generated/FormatArgsArg.qll e07a1ae310f590003f1b88fada7dcf4847c99adb9d4c838d1c88e66e1da85c5f 0ef7342451fe2cb06e765fb4b33bb8c4a9b927f5edbc8feb5c6ba3655697f447 lib/codeql/rust/elements/internal/generated/FormatArgsExpr.qll 40d6daa7d2bafb33798a21d79774dc802cfbd7a31618ac3bd0149399ea2bf893 d1172e2151791228559004792e125fc4625f6a26ffad25f29efb0ad263bf8795 lib/codeql/rust/elements/internal/generated/Function.qll b239af1a8874802b8a311706c53d56e3ceaad7ed23a7f97d1694bf961b63768b 4bc3c23685fa05820222e472ab1cdb40a271f862727d3bd878d47de9c2e3f485 -lib/codeql/rust/elements/internal/generated/FunctionOrMethodCallExpr.qll 5c6e3b4e4d3a91d0bb934dd2402898767ef6156b7b419222dfbc144167780231 67c82e154ff4c68f601fd92ba8aad7a8dd5b688dc89189744e1515bb647e9669 lib/codeql/rust/elements/internal/generated/GenericArg.qll 464da0ba1c5ddcd1be68617167f177773d99b5ac4775ec8ea24d503e789a9099 6faa1033d59baf7c210ac4837a55781cfc054b7acbad8027faf4630dbfa6e101 lib/codeql/rust/elements/internal/generated/GenericArgList.qll b8cd936bba6f28344e28c98acf38acb8ef43af6ecf8367d79ed487e5b9da17cb 8b14331261e49d004807285b02fca190aafd62bfb9378b05c7d9c1e95525fe7b lib/codeql/rust/elements/internal/generated/GenericParam.qll a0285123f974f287154b706bf6688b86edf72a4adcec57346c654d962435651b b42c3915e9564b5b5c5282229bf882aa3309de26a77721b2255d6f4235c0cc38 @@ -523,7 +523,7 @@ lib/codeql/rust/elements/internal/generated/MatchArmList.qll 13362680c037fe83fef lib/codeql/rust/elements/internal/generated/MatchExpr.qll 689d65f690fe05bc262d0a5bfe69bb4f8a142db387c5765fcc4958a9b49989f8 2979cd2017d0538870d17b2b7592c75cc05b706bd36c9de3e5dc38fa3a957e5b lib/codeql/rust/elements/internal/generated/MatchGuard.qll 521a507883963106780f1782084c581fbcf1179863c7c15438c4db79e30e78dd 6226feffaaa8d828a42ece0c693e616cd375672eb987c3b7ff1ca15fa23c116a lib/codeql/rust/elements/internal/generated/Meta.qll f1ce7cdaf2a6fa3b86f0465e33a9521d254c032468427b276d93276ffd5142be 046d72c868ee2664b8a291de16320238ece9d0612c93c96a0d601e0b6079bf90 -lib/codeql/rust/elements/internal/generated/MethodCallExpr.qll 89f5d6248ea338f0b3add9de4166df411bce2f8589b164d0a69db4650e4bcd71 3e13ddfa857e0a3655e7030b3d4ab411b09d6f0ea960b098f54ffcc1d8394d91 +lib/codeql/rust/elements/internal/generated/MethodCallExpr.qll 0966b268c9d71a8007044d608935e0c07d2144eaafef4812ef259d68b00a06f4 b3a5ab7ec79a6cfa55f671288b8c7c946883fd2edc0b3fac68221ab742cf8604 lib/codeql/rust/elements/internal/generated/Missing.qll 16735d91df04a4e1ae52fae25db5f59a044e540755734bbab46b5fbb0fe6b0bd 28ca4e49fb7e6b4734be2f2f69e7c224c570344cc160ef80c5a5cd413e750dad lib/codeql/rust/elements/internal/generated/Module.qll ebae5d8963c9fd569c0fbad1d7770abd3fd2479437f236cbce0505ba9f9af52c fa3c382115fed18a26f1a755d8749a201b9489f82c09448a88fb8e9e1435fe5f lib/codeql/rust/elements/internal/generated/Name.qll 12aad57744b7d1b04454159536409244c47319aedd580acb58ee93ef9d7f837d 63fc67ccc085db22f82576a53489f15216a7c29d5b941b14a965eab481534e2e @@ -536,7 +536,7 @@ lib/codeql/rust/elements/internal/generated/ParamList.qll c808c9d84dd7800573832b lib/codeql/rust/elements/internal/generated/ParenExpr.qll bc0731505bfe88516205ec360582a4222d2681d11342c93e15258590ddee82f2 d4bd6e0c80cf1d63746c88d4bcb3a01d4c75732e5da09e3ebd9437ced227fb60 lib/codeql/rust/elements/internal/generated/ParenPat.qll ce24b8f8ecbf0f204af200317405724063887257460c80cf250c39b2fdf37185 e7c87d37e1a0ca7ea03840017e1aa9ddb7f927f1f3b6396c0305b46aeee33db6 lib/codeql/rust/elements/internal/generated/ParenType.qll 9cc954d73f8330dcac7b475f97748b63af5c8766dee9d2f2872c0a7e4c903537 c07534c8a9c683c4a9b11d490095647e420de0a0bfc23273eaf6f31b00244273 -lib/codeql/rust/elements/internal/generated/ParentChild.qll 36a5d76d16a00cb18ee2e3193708b795e502ca9a92e72b8047e215961da3c5c8 dae8c9eda242e6d4c153f070ea4eefe1cbaae44aa148c5a79a852c9f1c8f7b2d +lib/codeql/rust/elements/internal/generated/ParentChild.qll 37dde0401161d1a4a668d89418b8f1d5afeaceecf7af54d4302ab30907a8a83e 8000db77bab203447063283adb8d0835731c802bc17ef4ffb39cbdb855cef993 lib/codeql/rust/elements/internal/generated/Pat.qll 3605ac062be2f294ee73336e9669027b8b655f4ad55660e1eab35266275154ee 7f9400db2884d336dd1d21df2a8093759c2a110be9bf6482ce8e80ae0fd74ed4 lib/codeql/rust/elements/internal/generated/Path.qll 299abce24762a5ab023f3cf1ab9718b83047e171aed42a8092e7a155914b1657 db1a23d18640c548f08c9f94823838b5e019ac85877c7b15df2d1493d1846572 lib/codeql/rust/elements/internal/generated/PathExpr.qll 17cdb0a7393258a207450f08e37178fc9d35d167f064ba6015be94246f3dc933 a75fdd280aff6d87e083a92030e041c2eb52b57cf7151d4a6989fcd31d6a64bf @@ -548,7 +548,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 468493674e9f891b6b289d07dd3f6d4369ab04411b8d20a81673f56dfe3abeb4 5876c9a5cc5ede7503b9f524184585abf8fba21fa94887033d2488205d3b4f94 +lib/codeql/rust/elements/internal/generated/Raw.qll ca7eab2abc07ed3b241694a1ab9bafb920b892b0b4e873e0d522c1b11e68195b 8a29d6f4a4a580c9d4bd43023e0e14fc0e539b82745e36918de44a689ca4477a 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 @@ -573,7 +573,7 @@ lib/codeql/rust/elements/internal/generated/Static.qll cae5313e08e4af44c46b25802 lib/codeql/rust/elements/internal/generated/Stmt.qll 8473ff532dd5cc9d7decaddcd174b94d610f6ca0aec8e473cc051dad9f3db917 6ef7d2b5237c2dbdcacbf7d8b39109d4dc100229f2b28b5c9e3e4fbf673ba72b lib/codeql/rust/elements/internal/generated/StmtList.qll a667193e32341e17400867c6e359878c4e645ef9f5f4d97676afc0283a33a026 a320ed678ee359302e2fc1b70a9476705cd616fcfa44a499d32f0c7715627f73 lib/codeql/rust/elements/internal/generated/Struct.qll 4d57f0db12dc7ad3e31e750a24172ef1505406b4dab16386af0674bd18bf8f4b 1a73c83df926b996f629316f74c61ea775be04532ab61b56af904223354f033e -lib/codeql/rust/elements/internal/generated/Synth.qll 908954d21685d16362d15c4170de397fd0af45bcd2038245b863196c96f0caeb 2a696c02a9c57411312ecbad592abd3718d4e73fbd070a2c5b03273358ed3c9d +lib/codeql/rust/elements/internal/generated/Synth.qll a87bb2f82978d4baf9234627d2c7769f2395ab6d164b12b72011f96a95096ce4 0342246219252dd29608e07398f4036d99d9b88d9b2e8e9873a93e9bb6d9535c lib/codeql/rust/elements/internal/generated/SynthConstructors.qll 518b68ccf6d0791bc0c141486261108bb1723e37743fc7f8e4167a1d61660531 518b68ccf6d0791bc0c141486261108bb1723e37743fc7f8e4167a1d61660531 lib/codeql/rust/elements/internal/generated/Token.qll 77a91a25ca5669703cf3a4353b591cef4d72caa6b0b9db07bb9e005d69c848d1 2fdffc4882ed3a6ca9ac6d1fb5f1ac5a471ca703e2ffdc642885fa558d6e373b lib/codeql/rust/elements/internal/generated/TokenTree.qll 8577c2b097c1be2f0f7daa5acfcf146f78674a424d99563e08a84dd3e6d91b46 d2f30764e84dbfc0a6a5d3d8a5f935cd432413688cb32da9c94e420fbc10665c @@ -608,7 +608,7 @@ lib/codeql/rust/elements/internal/generated/WhileExpr.qll fec8a9211b82a80601bf73 lib/codeql/rust/elements/internal/generated/WildcardPat.qll d74b70b57a0a66bfae017a329352a5b27a6b9e73dd5521d627f680e810c6c59e 4b913b548ba27ff3c82fcd32cf996ff329cb57d176d3bebd0fcef394486ea499 lib/codeql/rust/elements/internal/generated/YeetExpr.qll cac328200872a35337b4bcb15c851afb4743f82c080f9738d295571eb01d7392 94af734eea08129b587fed849b643e7572800e8330c0b57d727d41abda47930b lib/codeql/rust/elements/internal/generated/YieldExpr.qll 37e5f0c1e373a22bbc53d8b7f2c0e1f476e5be5080b8437c5e964f4e83fad79a 4a9a68643401637bf48e5c2b2f74a6bf0ddcb4ff76f6bffb61d436b685621e85 -lib/codeql/rust/elements.qll c647c2f20c9d20d49214026ea0e2965d0b751db567baceaf7a9225a8efa2546b c647c2f20c9d20d49214026ea0e2965d0b751db567baceaf7a9225a8efa2546b +lib/codeql/rust/elements.qll 78908ca1e1988b47323eb47fa58bcceeb984022fa40f89fb0af4f7219d2dd77b 78908ca1e1988b47323eb47fa58bcceeb984022fa40f89fb0af4f7219d2dd77b test/extractor-tests/generated/Abi/Abi.ql 7f6e7dc4af86eca3ebdc79b10373988cd0871bd78b51997d3cffd969105e5fdd 2f936b6ca005c6157c755121584410c03e4a3949c23bee302fbe05ee10ce118f test/extractor-tests/generated/Abi/Abi_getAbiString.ql a496762fcec5a0887b87023bbf93e9b650f02e20113e25c44d6e4281ae8f5335 14109c7ce11ba25e3cd6e7f1b3fcb4cb00622f2a4eac91bfe43145c5f366bc52 test/extractor-tests/generated/ArgList/ArgList.ql e412927756e72165d0e7c5c9bd3fca89d08197bbf760db8fb7683c64bb2229bc 043dba8506946fbb87753e22c387987d7eded6ddb963aa067f9e60ef9024d684 diff --git a/rust/ql/.gitattributes b/rust/ql/.gitattributes index 63630aa20cc..6069457be45 100644 --- a/rust/ql/.gitattributes +++ b/rust/ql/.gitattributes @@ -17,6 +17,7 @@ /lib/codeql/rust/elements/BoxPat.qll linguist-generated /lib/codeql/rust/elements/BreakExpr.qll linguist-generated /lib/codeql/rust/elements/CallExpr.qll linguist-generated +/lib/codeql/rust/elements/CallExprBase.qll linguist-generated /lib/codeql/rust/elements/CastExpr.qll linguist-generated /lib/codeql/rust/elements/ClosureBinder.qll linguist-generated /lib/codeql/rust/elements/ClosureExpr.qll linguist-generated @@ -43,7 +44,6 @@ /lib/codeql/rust/elements/FormatArgsArg.qll linguist-generated /lib/codeql/rust/elements/FormatArgsExpr.qll linguist-generated /lib/codeql/rust/elements/Function.qll linguist-generated -/lib/codeql/rust/elements/FunctionOrMethodCallExpr.qll linguist-generated /lib/codeql/rust/elements/GenericArg.qll linguist-generated /lib/codeql/rust/elements/GenericArgList.qll linguist-generated /lib/codeql/rust/elements/GenericParam.qll linguist-generated @@ -186,6 +186,7 @@ /lib/codeql/rust/elements/internal/BoxPatConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/BoxPatImpl.qll linguist-generated /lib/codeql/rust/elements/internal/BreakExprConstructor.qll linguist-generated +/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll linguist-generated /lib/codeql/rust/elements/internal/CallExprConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/CallExprImpl.qll linguist-generated /lib/codeql/rust/elements/internal/CastExprConstructor.qll linguist-generated @@ -232,7 +233,6 @@ /lib/codeql/rust/elements/internal/FormatArgsExprConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/FormatArgsExprImpl.qll linguist-generated /lib/codeql/rust/elements/internal/FunctionConstructor.qll linguist-generated -/lib/codeql/rust/elements/internal/FunctionOrMethodCallExprImpl.qll linguist-generated /lib/codeql/rust/elements/internal/GenericArgImpl.qll linguist-generated /lib/codeql/rust/elements/internal/GenericArgListConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/GenericArgListImpl.qll linguist-generated @@ -464,6 +464,7 @@ /lib/codeql/rust/elements/internal/generated/BoxPat.qll linguist-generated /lib/codeql/rust/elements/internal/generated/BreakExpr.qll linguist-generated /lib/codeql/rust/elements/internal/generated/CallExpr.qll linguist-generated +/lib/codeql/rust/elements/internal/generated/CallExprBase.qll linguist-generated /lib/codeql/rust/elements/internal/generated/CastExpr.qll linguist-generated /lib/codeql/rust/elements/internal/generated/ClosureBinder.qll linguist-generated /lib/codeql/rust/elements/internal/generated/ClosureExpr.qll linguist-generated @@ -490,7 +491,6 @@ /lib/codeql/rust/elements/internal/generated/FormatArgsArg.qll linguist-generated /lib/codeql/rust/elements/internal/generated/FormatArgsExpr.qll linguist-generated /lib/codeql/rust/elements/internal/generated/Function.qll linguist-generated -/lib/codeql/rust/elements/internal/generated/FunctionOrMethodCallExpr.qll linguist-generated /lib/codeql/rust/elements/internal/generated/GenericArg.qll linguist-generated /lib/codeql/rust/elements/internal/generated/GenericArgList.qll linguist-generated /lib/codeql/rust/elements/internal/generated/GenericParam.qll linguist-generated diff --git a/rust/ql/lib/codeql/rust/elements.qll b/rust/ql/lib/codeql/rust/elements.qll index 3795ecbe6c5..77aad9315c1 100644 --- a/rust/ql/lib/codeql/rust/elements.qll +++ b/rust/ql/lib/codeql/rust/elements.qll @@ -20,6 +20,7 @@ import codeql.rust.elements.BlockExpr import codeql.rust.elements.BoxPat import codeql.rust.elements.BreakExpr import codeql.rust.elements.CallExpr +import codeql.rust.elements.CallExprBase import codeql.rust.elements.CastExpr import codeql.rust.elements.ClosureBinder import codeql.rust.elements.ClosureExpr @@ -46,7 +47,6 @@ import codeql.rust.elements.ForType import codeql.rust.elements.FormatArgsArg import codeql.rust.elements.FormatArgsExpr import codeql.rust.elements.Function -import codeql.rust.elements.FunctionOrMethodCallExpr import codeql.rust.elements.GenericArg import codeql.rust.elements.GenericArgList import codeql.rust.elements.GenericParam diff --git a/rust/ql/lib/codeql/rust/elements/CallExpr.qll b/rust/ql/lib/codeql/rust/elements/CallExpr.qll index bf637cb29a6..ab5631b07ca 100644 --- a/rust/ql/lib/codeql/rust/elements/CallExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/CallExpr.qll @@ -4,8 +4,8 @@ */ private import internal.CallExprImpl +import codeql.rust.elements.CallExprBase import codeql.rust.elements.Expr -import codeql.rust.elements.FunctionOrMethodCallExpr /** * A function call expression. For example: diff --git a/rust/ql/lib/codeql/rust/elements/FunctionOrMethodCallExpr.qll b/rust/ql/lib/codeql/rust/elements/CallExprBase.qll similarity index 56% rename from rust/ql/lib/codeql/rust/elements/FunctionOrMethodCallExpr.qll rename to rust/ql/lib/codeql/rust/elements/CallExprBase.qll index 3635c33e324..d59c4c705f7 100644 --- a/rust/ql/lib/codeql/rust/elements/FunctionOrMethodCallExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/CallExprBase.qll @@ -1,9 +1,9 @@ // generated by codegen, do not edit /** - * This module provides the public class `FunctionOrMethodCallExpr`. + * This module provides the public class `CallExprBase`. */ -private import internal.FunctionOrMethodCallExprImpl +private import internal.CallExprBaseImpl import codeql.rust.elements.ArgList import codeql.rust.elements.Attr import codeql.rust.elements.Expr @@ -11,4 +11,4 @@ import codeql.rust.elements.Expr /** * A function or method call expression. See `CallExpr` and `MethodCallExpr` for further details. */ -final class FunctionOrMethodCallExpr = Impl::FunctionOrMethodCallExpr; +final class CallExprBase = Impl::CallExprBase; diff --git a/rust/ql/lib/codeql/rust/elements/MethodCallExpr.qll b/rust/ql/lib/codeql/rust/elements/MethodCallExpr.qll index 3646d987f9f..fca8b086134 100644 --- a/rust/ql/lib/codeql/rust/elements/MethodCallExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/MethodCallExpr.qll @@ -4,8 +4,8 @@ */ private import internal.MethodCallExprImpl +import codeql.rust.elements.CallExprBase import codeql.rust.elements.Expr -import codeql.rust.elements.FunctionOrMethodCallExpr import codeql.rust.elements.GenericArgList import codeql.rust.elements.NameRef diff --git a/rust/ql/lib/codeql/rust/elements/internal/FunctionOrMethodCallExprImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll similarity index 62% rename from rust/ql/lib/codeql/rust/elements/internal/FunctionOrMethodCallExprImpl.qll rename to rust/ql/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll index 1ad34f210cf..332ba0fb6b3 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/FunctionOrMethodCallExprImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll @@ -1,19 +1,19 @@ // generated by codegen, remove this comment if you wish to edit this file /** - * This module provides a hand-modifiable wrapper around the generated class `FunctionOrMethodCallExpr`. + * This module provides a hand-modifiable wrapper around the generated class `CallExprBase`. * * INTERNAL: Do not use. */ -private import codeql.rust.elements.internal.generated.FunctionOrMethodCallExpr +private import codeql.rust.elements.internal.generated.CallExprBase /** - * INTERNAL: This module contains the customizable definition of `FunctionOrMethodCallExpr` and should not + * INTERNAL: This module contains the customizable definition of `CallExprBase` and should not * be referenced directly. */ module Impl { /** * A function or method call expression. See `CallExpr` and `MethodCallExpr` for further details. */ - class FunctionOrMethodCallExpr extends Generated::FunctionOrMethodCallExpr { } + class CallExprBase extends Generated::CallExprBase { } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/CallExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/CallExpr.qll index 66b4ce10cb7..2e41b664a4e 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/CallExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/CallExpr.qll @@ -6,8 +6,8 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw +import codeql.rust.elements.internal.CallExprBaseImpl::Impl as CallExprBaseImpl import codeql.rust.elements.Expr -import codeql.rust.elements.internal.FunctionOrMethodCallExprImpl::Impl as FunctionOrMethodCallExprImpl /** * INTERNAL: This module contains the fully generated definition of `CallExpr` and should not @@ -25,7 +25,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::CallExpr` class directly. * Use the subclass `CallExpr`, where the following predicates are available. */ - class CallExpr extends Synth::TCallExpr, FunctionOrMethodCallExprImpl::FunctionOrMethodCallExpr { + class CallExpr extends Synth::TCallExpr, CallExprBaseImpl::CallExprBase { override string getAPrimaryQlClass() { result = "CallExpr" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/FunctionOrMethodCallExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/CallExprBase.qll similarity index 51% rename from rust/ql/lib/codeql/rust/elements/internal/generated/FunctionOrMethodCallExpr.qll rename to rust/ql/lib/codeql/rust/elements/internal/generated/CallExprBase.qll index e4ecbaa1a69..046558c356d 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/FunctionOrMethodCallExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/CallExprBase.qll @@ -1,6 +1,6 @@ // generated by codegen, do not edit /** - * This module provides the generated definition of `FunctionOrMethodCallExpr`. + * This module provides the generated definition of `CallExprBase`. * INTERNAL: Do not import directly. */ @@ -11,23 +11,23 @@ import codeql.rust.elements.Attr import codeql.rust.elements.internal.ExprImpl::Impl as ExprImpl /** - * INTERNAL: This module contains the fully generated definition of `FunctionOrMethodCallExpr` and should not + * INTERNAL: This module contains the fully generated definition of `CallExprBase` and should not * be referenced directly. */ module Generated { /** * A function or method call expression. See `CallExpr` and `MethodCallExpr` for further details. - * INTERNAL: Do not reference the `Generated::FunctionOrMethodCallExpr` class directly. - * Use the subclass `FunctionOrMethodCallExpr`, where the following predicates are available. + * INTERNAL: Do not reference the `Generated::CallExprBase` class directly. + * Use the subclass `CallExprBase`, where the following predicates are available. */ - class FunctionOrMethodCallExpr extends Synth::TFunctionOrMethodCallExpr, ExprImpl::Expr { + class CallExprBase extends Synth::TCallExprBase, ExprImpl::Expr { /** - * Gets the argument list of this function or method call expression, if it exists. + * Gets the argument list of this call expression base, if it exists. */ ArgList getArgList() { result = - Synth::convertArgListFromRaw(Synth::convertFunctionOrMethodCallExprToRaw(this) - .(Raw::FunctionOrMethodCallExpr) + Synth::convertArgListFromRaw(Synth::convertCallExprBaseToRaw(this) + .(Raw::CallExprBase) .getArgList()) } @@ -37,22 +37,22 @@ module Generated { final predicate hasArgList() { exists(this.getArgList()) } /** - * Gets the `index`th attr of this function or method call expression (0-based). + * Gets the `index`th attr of this call expression base (0-based). */ Attr getAttr(int index) { result = - Synth::convertAttrFromRaw(Synth::convertFunctionOrMethodCallExprToRaw(this) - .(Raw::FunctionOrMethodCallExpr) + Synth::convertAttrFromRaw(Synth::convertCallExprBaseToRaw(this) + .(Raw::CallExprBase) .getAttr(index)) } /** - * Gets any of the attrs of this function or method call expression. + * Gets any of the attrs of this call expression base. */ final Attr getAnAttr() { result = this.getAttr(_) } /** - * Gets the number of attrs of this function or method call expression. + * Gets the number of attrs of this call expression base. */ final int getNumberOfAttrs() { result = count(int i | exists(this.getAttr(i))) } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/MethodCallExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/MethodCallExpr.qll index de5cef9e70b..4aeb89e8e85 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/MethodCallExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/MethodCallExpr.qll @@ -6,8 +6,8 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw +import codeql.rust.elements.internal.CallExprBaseImpl::Impl as CallExprBaseImpl import codeql.rust.elements.Expr -import codeql.rust.elements.internal.FunctionOrMethodCallExprImpl::Impl as FunctionOrMethodCallExprImpl import codeql.rust.elements.GenericArgList import codeql.rust.elements.NameRef @@ -25,9 +25,7 @@ module Generated { * INTERNAL: Do not reference the `Generated::MethodCallExpr` class directly. * Use the subclass `MethodCallExpr`, where the following predicates are available. */ - class MethodCallExpr extends Synth::TMethodCallExpr, - FunctionOrMethodCallExprImpl::FunctionOrMethodCallExpr - { + class MethodCallExpr extends Synth::TMethodCallExpr, CallExprBaseImpl::CallExprBase { override string getAPrimaryQlClass() { result = "MethodCallExpr" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll index 4dbb92f77f9..5a895eff78b 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll @@ -1380,6 +1380,28 @@ private module Impl { ) } + private Element getImmediateChildOfCallExprBase( + CallExprBase e, int index, string partialPredicateCall + ) { + exists(int b, int bExpr, int n, int nArgList, int nAttr | + b = 0 and + bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and + n = bExpr and + nArgList = n + 1 and + nAttr = nArgList + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and + ( + none() + or + result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) + or + index = n and result = e.getArgList() and partialPredicateCall = "ArgList()" + or + result = e.getAttr(index - nArgList) and + partialPredicateCall = "Attr(" + (index - nArgList).toString() + ")" + ) + ) + } + private Element getImmediateChildOfCastExpr(CastExpr e, int index, string partialPredicateCall) { exists(int b, int bExpr, int n, int nAttr, int nExpr, int nTy | b = 0 and @@ -1691,28 +1713,6 @@ private module Impl { ) } - private Element getImmediateChildOfFunctionOrMethodCallExpr( - FunctionOrMethodCallExpr e, int index, string partialPredicateCall - ) { - exists(int b, int bExpr, int n, int nArgList, int nAttr | - b = 0 and - bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and - n = bExpr and - nArgList = n + 1 and - nAttr = nArgList + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and - ( - none() - or - result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) - or - index = n and result = e.getArgList() and partialPredicateCall = "ArgList()" - or - result = e.getAttr(index - nArgList) and - partialPredicateCall = "Attr(" + (index - nArgList).toString() + ")" - ) - ) - } - private Element getImmediateChildOfIdentPat(IdentPat e, int index, string partialPredicateCall) { exists(int b, int bPat, int n, int nAttr, int nName, int nPat | b = 0 and @@ -2744,17 +2744,16 @@ private module Impl { } private Element getImmediateChildOfCallExpr(CallExpr e, int index, string partialPredicateCall) { - exists(int b, int bFunctionOrMethodCallExpr, int n, int nExpr | + exists(int b, int bCallExprBase, int n, int nExpr | b = 0 and - bFunctionOrMethodCallExpr = - b + 1 + - max(int i | i = -1 or exists(getImmediateChildOfFunctionOrMethodCallExpr(e, i, _)) | i) and - n = bFunctionOrMethodCallExpr and + bCallExprBase = + b + 1 + max(int i | i = -1 or exists(getImmediateChildOfCallExprBase(e, i, _)) | i) and + n = bCallExprBase and nExpr = n + 1 and ( none() or - result = getImmediateChildOfFunctionOrMethodCallExpr(e, index - b, partialPredicateCall) + result = getImmediateChildOfCallExprBase(e, index - b, partialPredicateCall) or index = n and result = e.getExpr() and partialPredicateCall = "Expr()" ) @@ -3080,21 +3079,18 @@ private module Impl { private Element getImmediateChildOfMethodCallExpr( MethodCallExpr e, int index, string partialPredicateCall ) { - exists( - int b, int bFunctionOrMethodCallExpr, int n, int nGenericArgList, int nNameRef, int nReceiver - | + exists(int b, int bCallExprBase, int n, int nGenericArgList, int nNameRef, int nReceiver | b = 0 and - bFunctionOrMethodCallExpr = - b + 1 + - max(int i | i = -1 or exists(getImmediateChildOfFunctionOrMethodCallExpr(e, i, _)) | i) and - n = bFunctionOrMethodCallExpr and + bCallExprBase = + b + 1 + max(int i | i = -1 or exists(getImmediateChildOfCallExprBase(e, i, _)) | i) and + n = bCallExprBase and nGenericArgList = n + 1 and nNameRef = nGenericArgList + 1 and nReceiver = nNameRef + 1 and ( none() or - result = getImmediateChildOfFunctionOrMethodCallExpr(e, index - b, partialPredicateCall) + result = getImmediateChildOfCallExprBase(e, index - b, partialPredicateCall) or index = n and result = e.getGenericArgList() and partialPredicateCall = "GenericArgList()" or 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 57d3827561c..28ee45ebef2 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll @@ -1395,6 +1395,22 @@ module Raw { Lifetime getLifetime() { break_expr_lifetimes(this, result) } } + /** + * INTERNAL: Do not use. + * A function or method call expression. See `CallExpr` and `MethodCallExpr` for further details. + */ + class CallExprBase extends @call_expr_base, Expr { + /** + * Gets the argument list of this call expression base, if it exists. + */ + ArgList getArgList() { call_expr_base_arg_lists(this, result) } + + /** + * Gets the `index`th attr of this call expression base (0-based). + */ + Attr getAttr(int index) { call_expr_base_attrs(this, index, result) } + } + /** * INTERNAL: Do not use. * A cast expression. For example: @@ -1752,22 +1768,6 @@ module Raw { Expr getTemplate() { format_args_expr_templates(this, result) } } - /** - * INTERNAL: Do not use. - * A function or method call expression. See `CallExpr` and `MethodCallExpr` for further details. - */ - class FunctionOrMethodCallExpr extends @function_or_method_call_expr, Expr { - /** - * Gets the argument list of this function or method call expression, if it exists. - */ - ArgList getArgList() { function_or_method_call_expr_arg_lists(this, result) } - - /** - * Gets the `index`th attr of this function or method call expression (0-based). - */ - Attr getAttr(int index) { function_or_method_call_expr_attrs(this, index, result) } - } - /** * INTERNAL: Do not use. * A binding pattern. For example: @@ -2959,7 +2959,7 @@ module Raw { * foo(1) = 4; * ``` */ - class CallExpr extends @call_expr, FunctionOrMethodCallExpr { + class CallExpr extends @call_expr, CallExprBase { override string toString() { result = "CallExpr" } /** @@ -3311,7 +3311,7 @@ module Raw { * x.foo::(42); * ``` */ - class MethodCallExpr extends @method_call_expr, FunctionOrMethodCallExpr { + class MethodCallExpr extends @method_call_expr, CallExprBase { override string toString() { result = "MethodCallExpr" } /** diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll index 192f22dae05..bd3ddf9feb4 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll @@ -603,16 +603,21 @@ module Synth { TUseTree or TUseTreeList or TVariant or TVariantList or TVisibility or TWhereClause or TWherePred; + /** + * INTERNAL: Do not use. + */ + class TCallExprBase = TCallExpr or TMethodCallExpr; + /** * INTERNAL: Do not use. */ class TExpr = TArrayExpr or TAsmExpr or TAwaitExpr or TBecomeExpr or TBinaryExpr or TBlockExpr or - TBreakExpr or TCastExpr or TClosureExpr or TContinueExpr or TFieldExpr or TForExpr or - TFormatArgsExpr or TFunctionOrMethodCallExpr or TIfExpr or TIndexExpr or TLetExpr or - TLiteralExpr or TLoopExpr or TMacroExpr or TMatchExpr or TOffsetOfExpr or TParenExpr or - TPathExpr or TPrefixExpr or TRangeExpr or TRecordExpr or TRefExpr or TReturnExpr or - TTryExpr or TTupleExpr or TUnderscoreExpr or TWhileExpr or TYeetExpr or TYieldExpr; + TBreakExpr or TCallExprBase or TCastExpr or TClosureExpr or TContinueExpr or TFieldExpr or + TForExpr or TFormatArgsExpr or TIfExpr or TIndexExpr or TLetExpr or TLiteralExpr or + TLoopExpr or TMacroExpr or TMatchExpr or TOffsetOfExpr or TParenExpr or TPathExpr or + TPrefixExpr or TRangeExpr or TRecordExpr or TRefExpr or TReturnExpr or TTryExpr or + TTupleExpr or TUnderscoreExpr or TWhileExpr or TYeetExpr or TYieldExpr; /** * INTERNAL: Do not use. @@ -624,11 +629,6 @@ module Synth { */ class TFieldList = TRecordFieldList or TTupleFieldList; - /** - * INTERNAL: Do not use. - */ - class TFunctionOrMethodCallExpr = TCallExpr or TMethodCallExpr; - /** * INTERNAL: Do not use. */ @@ -1669,6 +1669,16 @@ module Synth { result = convertWherePredFromRaw(e) } + /** + * INTERNAL: Do not use. + * Converts a raw DB element to a synthesized `TCallExprBase`, if possible. + */ + TCallExprBase convertCallExprBaseFromRaw(Raw::Element e) { + result = convertCallExprFromRaw(e) + or + result = convertMethodCallExprFromRaw(e) + } + /** * INTERNAL: Do not use. * Converts a raw DB element to a synthesized `TElement`, if possible. @@ -1698,6 +1708,8 @@ module Synth { or result = convertBreakExprFromRaw(e) or + result = convertCallExprBaseFromRaw(e) + or result = convertCastExprFromRaw(e) or result = convertClosureExprFromRaw(e) @@ -1710,8 +1722,6 @@ module Synth { or result = convertFormatArgsExprFromRaw(e) or - result = convertFunctionOrMethodCallExprFromRaw(e) - or result = convertIfExprFromRaw(e) or result = convertIndexExprFromRaw(e) @@ -1779,16 +1789,6 @@ module Synth { result = convertTupleFieldListFromRaw(e) } - /** - * INTERNAL: Do not use. - * Converts a raw DB element to a synthesized `TFunctionOrMethodCallExpr`, if possible. - */ - TFunctionOrMethodCallExpr convertFunctionOrMethodCallExprFromRaw(Raw::Element e) { - result = convertCallExprFromRaw(e) - or - result = convertMethodCallExprFromRaw(e) - } - /** * INTERNAL: Do not use. * Converts a raw DB element to a synthesized `TGenericArg`, if possible. @@ -2947,6 +2947,16 @@ module Synth { result = convertWherePredToRaw(e) } + /** + * INTERNAL: Do not use. + * Converts a synthesized `TCallExprBase` to a raw DB element, if possible. + */ + Raw::Element convertCallExprBaseToRaw(TCallExprBase e) { + result = convertCallExprToRaw(e) + or + result = convertMethodCallExprToRaw(e) + } + /** * INTERNAL: Do not use. * Converts a synthesized `TElement` to a raw DB element, if possible. @@ -2976,6 +2986,8 @@ module Synth { or result = convertBreakExprToRaw(e) or + result = convertCallExprBaseToRaw(e) + or result = convertCastExprToRaw(e) or result = convertClosureExprToRaw(e) @@ -2988,8 +3000,6 @@ module Synth { or result = convertFormatArgsExprToRaw(e) or - result = convertFunctionOrMethodCallExprToRaw(e) - or result = convertIfExprToRaw(e) or result = convertIndexExprToRaw(e) @@ -3057,16 +3067,6 @@ module Synth { result = convertTupleFieldListToRaw(e) } - /** - * INTERNAL: Do not use. - * Converts a synthesized `TFunctionOrMethodCallExpr` to a raw DB element, if possible. - */ - Raw::Element convertFunctionOrMethodCallExprToRaw(TFunctionOrMethodCallExpr e) { - result = convertCallExprToRaw(e) - or - result = convertMethodCallExprToRaw(e) - } - /** * INTERNAL: Do not use. * Converts a synthesized `TGenericArg` to a raw DB element, if possible. diff --git a/rust/ql/lib/rust.dbscheme b/rust/ql/lib/rust.dbscheme index 113c3fe7d7e..bb46706d3a3 100644 --- a/rust/ql/lib/rust.dbscheme +++ b/rust/ql/lib/rust.dbscheme @@ -273,13 +273,13 @@ closure_binder_generic_param_lists( | @binary_expr | @block_expr | @break_expr +| @call_expr_base | @cast_expr | @closure_expr | @continue_expr | @field_expr | @for_expr | @format_args_expr -| @function_or_method_call_expr | @if_expr | @index_expr | @let_expr @@ -1300,6 +1300,24 @@ break_expr_lifetimes( int lifetime: @lifetime ref ); +@call_expr_base = + @call_expr +| @method_call_expr +; + +#keyset[id] +call_expr_base_arg_lists( + int id: @call_expr_base ref, + int arg_list: @arg_list ref +); + +#keyset[id, index] +call_expr_base_attrs( + int id: @call_expr_base ref, + int index: int ref, + int attr: @attr ref +); + cast_exprs( unique int id: @cast_expr ); @@ -1570,24 +1588,6 @@ format_args_expr_templates( int template: @expr ref ); -@function_or_method_call_expr = - @call_expr -| @method_call_expr -; - -#keyset[id] -function_or_method_call_expr_arg_lists( - int id: @function_or_method_call_expr ref, - int arg_list: @arg_list ref -); - -#keyset[id, index] -function_or_method_call_expr_attrs( - int id: @function_or_method_call_expr ref, - int index: int ref, - int attr: @attr ref -); - ident_pats( unique int id: @ident_pat ); diff --git a/rust/schema/annotations.py b/rust/schema/annotations.py index 7fafb26bbb3..5dcd085e405 100644 --- a/rust/schema/annotations.py +++ b/rust/schema/annotations.py @@ -185,7 +185,7 @@ class _: ``` """ -class FunctionOrMethodCallExpr(Expr): +class CallExprBase(Expr): """ A function or method call expression. See `CallExpr` and `MethodCallExpr` for further details. """ @@ -193,7 +193,7 @@ class FunctionOrMethodCallExpr(Expr): attrs: list["Attr"] | child -@annotate(CallExpr, replace_bases={Expr: FunctionOrMethodCallExpr}) +@annotate(CallExpr, replace_bases={Expr: CallExprBase}) class _: """ A function call expression. For example: @@ -207,7 +207,7 @@ class _: arg_list: drop attrs: drop -@annotate(MethodCallExpr, replace_bases={Expr: FunctionOrMethodCallExpr}) +@annotate(MethodCallExpr, replace_bases={Expr: CallExprBase}) class _: """ A method call expression. For example: