Rust: Adjust some generated Impl files

This commit is contained in:
Tom Hvitved
2024-09-16 09:34:07 +02:00
parent 4dd3059f16
commit 683ecc39d8
6 changed files with 32 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
# configuration file for Swift code generation default options
# configuration file for Rust code generation default options
--generate=dbscheme,rusttest,ql,rust
--dbscheme=ql/lib/rust.dbscheme
--ql-output=ql/lib/codeql/rust/generated

View File

@@ -52,7 +52,6 @@ lib/codeql/rust/elements/ContinueExprImpl.qll 7d6fa2d50521b2fda6f83e95cd0942cffb
lib/codeql/rust/elements/Declaration.qll 1b757fcc08e0e985aefbe0b30c902365d6a88e1d5f7f42aa6702b3e3fb6b4132 1b97a2b4c382e95a439ac3030c85618f80d8e93ddf6220f38b539a0d9183f971
lib/codeql/rust/elements/DeclarationImpl.qll e6df6737222dd34e4e5f34b747885591f599406b0a3908c2728bfc0486c52dbd 0667b034471b29d842a05dd09ac83ab50319d01e1832f036aa534fdd4dc202b9
lib/codeql/rust/elements/Element.qll 6ed9e11ce0019c62da70f67d1b59d93ebe8b0d1bed72c140f49adc5beea30434 92b05c6fcf9f9bd4891f54863691752562d5a124ebbe4d77edecc76ea414ded5
lib/codeql/rust/elements/ElementImpl.qll 68801f7181d83606f564bcccb9fbf732f93f2f2bf34d2c56dfb42753076dbfe0 f3f5fb2abfbb80737d7d4d1186a17cb48890ebf38d7d8ce7274bc3af400fbf64
lib/codeql/rust/elements/ElementListExpr.qll 784dea26eaf13d7bf4c53592537ebe5de973596264d550ee36504661cd1379b6 119e5cb596867660cd3e377e861642edf03569a30042f9c66c765c942b371c87
lib/codeql/rust/elements/ElementListExprConstructor.qll 12b06597e0700cd0eac70e42cbdc1a2d410e0ffcd05c21a213812a488b5b236b 7adb2e442f1bc362c44824aaba0ab4a7fb4a4bc550a3c96f963dc03bed582d39
lib/codeql/rust/elements/ElementListExprImpl.qll 138be703a78d73cc5708ca5377dd4753d046f26ef87f443112442a30cf72ef0d 8b51ca097e7961b2e42b6538ea86547acb3d557393870849e6ff217b9dafd191
@@ -66,7 +65,6 @@ lib/codeql/rust/elements/FieldExprConstructor.qll 75bd0526fae157460750f3ea1e087c
lib/codeql/rust/elements/FieldExprImpl.qll 185fcd3366311818d82720139691e0e61ae2f7d9b7504063a6f27b92c73090ce 0188255b062f78b734517e4238681c43f21f15da4245a53be10328d5b7213723
lib/codeql/rust/elements/Function.qll 975e978c7708a951b76d893c2227d8fde88bcf28cf96a787ee9c84ced5a5c56d c60f21f639e603f5c0c27e7a4c57ae5c0c752db102ffbbbabfbced33d43b1dd4
lib/codeql/rust/elements/FunctionConstructor.qll a9269b37182c0bf432f9b2b015691da5dbd64819b9bd25445af229d873014a91 69107a7503af14a51e091e6918094a4e9fc316a72de2e1514f001872ce0f2c0c
lib/codeql/rust/elements/FunctionImpl.qll bbea9216cb168b22b1da21a6ea5d501adf1bb21bad0f2662d9a5f3af9b46e1e6 5401113f2e35d1e60bcdd801bf7bab618882bfd235947b4790a7a80fde15b64d
lib/codeql/rust/elements/GenericArgList.qll 3acadef71e73321ab6db2b53ff7e968ed3fde596f56bac43aabb4c8bdf9c434d ad84f0cd4f7ed76456d464c7f875b2e1215c3bcd21b2b85aae0354728673e964
lib/codeql/rust/elements/GenericArgListConstructor.qll 68e8739557bb470c04ae12f6b39d34c6fa4966bfdad1768b9e4f1a596447cd72 e0fc7e51fea925b7f21e771eca7e1bb2d506d6992c80ecd7902c9656610e545c
lib/codeql/rust/elements/GenericArgListImpl.qll 3fe3826a6e23bb683b4fca86d0da4155e7ba51f22966ca9b3c48a8e5f8176a6f bd38a13edd91f152aefebdc953876874eaf52824cb8d4434431d783128ad2bad
@@ -98,7 +96,6 @@ lib/codeql/rust/elements/LiteralPat.qll 6751fcd478ff89b2ba506cbae1c4a1fcd244e693
lib/codeql/rust/elements/LiteralPatConstructor.qll abe137b2b8ec9dd9450fc77d2d826fe891bbb0af23b0c26ff5e2d1751988f747 e1642805588737ed98eebec1d16cb0fb9fd081db203ec725db85b02c4837bdcb
lib/codeql/rust/elements/LiteralPatImpl.qll 33032e844010ecda469e737d244517e2d810ca16cd225224f202639fae5f4c59 9ea23cd24f670dce019413d356540f52f6aac0c63f3abdd63dadf0d3216a3cf2
lib/codeql/rust/elements/Locatable.qll 109c1e7e029a167383d90fc1869631aed5e29b7a94c6b323dec2c1d0287ff6f8 97045c10db141863b976afbb58a8e38419e3e8da659cc6357c0f5436c8caba76
lib/codeql/rust/elements/LocatableImpl.qll 3271ca933a6ac1866665861ec26bbc0aabe98fdab44a5c81237b153c5b8d5b92 3d23cca6414c68300ab9ad9a8d41e3fcf90c44f6b715e178d81f0f7ca43bc01f
lib/codeql/rust/elements/LoopExpr.qll 564741998ebb1b5a040d2374707de9b1d65171233c063c8d291ed42a49b11a64 7eb9300656fc9b2fbdf3a2cc4d8c54b00906d1097cbdb58f74a6429f0b87f1db
lib/codeql/rust/elements/LoopExprConstructor.qll 635348fe22fb47c7e59bed02a8ed6420be5a9ce92a7d9bf4475465ee170c917b 2bcfe70247c55659b3a3e09562da52fc645cc3166748f268c5a38b35fca24233
lib/codeql/rust/elements/LoopExprImpl.qll f8bd97cc8bda1b224ed0ce8f7210c4ba212a6c4bfb3153b749fc8646db2b1dda f90481b2ca20e5a501463670b1d3bbb5e97106237e2df3ab987e137ea19485df

3
rust/ql/.gitattributes generated vendored
View File

@@ -54,7 +54,6 @@
/lib/codeql/rust/elements/Declaration.qll linguist-generated
/lib/codeql/rust/elements/DeclarationImpl.qll linguist-generated
/lib/codeql/rust/elements/Element.qll linguist-generated
/lib/codeql/rust/elements/ElementImpl.qll linguist-generated
/lib/codeql/rust/elements/ElementListExpr.qll linguist-generated
/lib/codeql/rust/elements/ElementListExprConstructor.qll linguist-generated
/lib/codeql/rust/elements/ElementListExprImpl.qll linguist-generated
@@ -68,7 +67,6 @@
/lib/codeql/rust/elements/FieldExprImpl.qll linguist-generated
/lib/codeql/rust/elements/Function.qll linguist-generated
/lib/codeql/rust/elements/FunctionConstructor.qll linguist-generated
/lib/codeql/rust/elements/FunctionImpl.qll linguist-generated
/lib/codeql/rust/elements/GenericArgList.qll linguist-generated
/lib/codeql/rust/elements/GenericArgListConstructor.qll linguist-generated
/lib/codeql/rust/elements/GenericArgListImpl.qll linguist-generated
@@ -100,7 +98,6 @@
/lib/codeql/rust/elements/LiteralPatConstructor.qll linguist-generated
/lib/codeql/rust/elements/LiteralPatImpl.qll linguist-generated
/lib/codeql/rust/elements/Locatable.qll linguist-generated
/lib/codeql/rust/elements/LocatableImpl.qll linguist-generated
/lib/codeql/rust/elements/LoopExpr.qll linguist-generated
/lib/codeql/rust/elements/LoopExprConstructor.qll linguist-generated
/lib/codeql/rust/elements/LoopExprImpl.qll linguist-generated

View File

@@ -1,4 +1,3 @@
// generated by codegen, remove this comment if you wish to edit this file
/**
* This module provides a hand-modifiable wrapper around the generated class `Element`.
*
@@ -12,5 +11,9 @@ private import codeql.rust.generated.Element
* be referenced directly.
*/
module Impl {
class Element extends Generated::Element { }
class Element extends Generated::Element {
override string toString() { result = this.getAPrimaryQlClass() }
predicate isUnknown() { none() } // compatibility with test generation, to be fixed
}
}

View File

@@ -1,4 +1,3 @@
// generated by codegen, remove this comment if you wish to edit this file
/**
* This module provides a hand-modifiable wrapper around the generated class `Function`.
*
@@ -12,6 +11,7 @@ private import codeql.rust.generated.Function
* be referenced directly.
*/
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* A function declaration. For example
* ```
@@ -24,5 +24,7 @@ module Impl {
* }
* ```
*/
class Function extends Generated::Function { }
class Function extends Generated::Function {
override string toString() { result = this.getName() }
}
}

View File

@@ -1,4 +1,3 @@
// generated by codegen, remove this comment if you wish to edit this file
/**
* This module provides a hand-modifiable wrapper around the generated class `Locatable`.
*
@@ -6,11 +5,32 @@
*/
private import codeql.rust.generated.Locatable
import codeql.Locations
private import codeql.rust.generated.Synth
private import codeql.rust.generated.Raw
/**
* INTERNAL: This module contains the customizable definition of `Locatable` and should not
* be referenced directly.
*/
module Impl {
class Locatable extends Generated::Locatable { }
class Locatable extends Generated::Locatable {
pragma[nomagic]
final Location getLocation() {
exists(Raw::Locatable raw |
raw = Synth::convertLocatableToRaw(this) and
(
locatable_locations(raw, result)
or
not exists(Location loc | locatable_locations(raw, loc)) and
result instanceof EmptyLocation
)
)
}
/**
* Gets the primary file where this element occurs.
*/
File getFile() { result = this.getLocation().getFile() }
}
}