Skip to content

Commit d72065b

Browse files
committed
Rust: Overrride toStringImpl for new elements classes
1 parent 11aebd5 commit d72065b

9 files changed

Lines changed: 28 additions & 28 deletions

File tree

rust/ql/.generated.list

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/ql/.gitattributes

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/ql/lib/codeql/rust/elements/internal/DerefPatImpl.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// generated by codegen, remove this comment if you wish to edit this file
21
/**
32
* This module provides a hand-modifiable wrapper around the generated class `DerefPat`.
43
*
@@ -12,6 +11,7 @@ private import codeql.rust.elements.internal.generated.DerefPat
1211
* be referenced directly.
1312
*/
1413
module Impl {
14+
// the following QLdoc is generated: if you need to edit it, do it in the schema file
1515
/**
1616
* A deref pattern, matching the value behind a smart pointer. This is an experimental
1717
* Rust feature that cannot be written directly in stable Rust; the example below uses
@@ -23,5 +23,7 @@ module Impl {
2323
* };
2424
* ```
2525
*/
26-
class DerefPat extends Generated::DerefPat { }
26+
class DerefPat extends Generated::DerefPat {
27+
override string toStringImpl() { result = this.getAPrimaryQlClass() }
28+
}
2729
}

rust/ql/lib/codeql/rust/elements/internal/ImplRestrictionImpl.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// generated by codegen, remove this comment if you wish to edit this file
21
/**
32
* This module provides a hand-modifiable wrapper around the generated class `ImplRestriction`.
43
*
@@ -12,8 +11,11 @@ private import codeql.rust.elements.internal.generated.ImplRestriction
1211
* be referenced directly.
1312
*/
1413
module Impl {
14+
// the following QLdoc is generated: if you need to edit it, do it in the schema file
1515
/**
1616
* An implementation restriction, limiting where a trait can be implemented. For example the `impl(crate)` restriction (an unstable feature).
1717
*/
18-
class ImplRestriction extends Generated::ImplRestriction { }
18+
class ImplRestriction extends Generated::ImplRestriction {
19+
override string toStringImpl() { result = this.getAPrimaryQlClass() }
20+
}
1921
}

rust/ql/lib/codeql/rust/elements/internal/IncludeBytesExprImpl.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// generated by codegen, remove this comment if you wish to edit this file
21
/**
32
* This module provides a hand-modifiable wrapper around the generated class `IncludeBytesExpr`.
43
*
@@ -12,11 +11,14 @@ private import codeql.rust.elements.internal.generated.IncludeBytesExpr
1211
* be referenced directly.
1312
*/
1413
module Impl {
14+
// the following QLdoc is generated: if you need to edit it, do it in the schema file
1515
/**
1616
* An expression produced by the built-in `include_bytes!` macro, embedding the contents of a file as a byte array. For example:
1717
* ```rust
1818
* let data = include_bytes!("data.bin");
1919
* ```
2020
*/
21-
class IncludeBytesExpr extends Generated::IncludeBytesExpr { }
21+
class IncludeBytesExpr extends Generated::IncludeBytesExpr {
22+
override string toStringImpl() { result = this.getAPrimaryQlClass() }
23+
}
2224
}

rust/ql/lib/codeql/rust/elements/internal/MutRestrictionImpl.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// generated by codegen, remove this comment if you wish to edit this file
21
/**
32
* This module provides a hand-modifiable wrapper around the generated class `MutRestriction`.
43
*
@@ -12,8 +11,11 @@ private import codeql.rust.elements.internal.generated.MutRestriction
1211
* be referenced directly.
1312
*/
1413
module Impl {
14+
// the following QLdoc is generated: if you need to edit it, do it in the schema file
1515
/**
1616
* A mutability restriction, limiting where a field can be mutated. For example the `mut(crate)` restriction (an unstable feature).
1717
*/
18-
class MutRestriction extends Generated::MutRestriction { }
18+
class MutRestriction extends Generated::MutRestriction {
19+
override string toStringImpl() { result = this.getAPrimaryQlClass() }
20+
}
1921
}

rust/ql/lib/codeql/rust/elements/internal/NotNullImpl.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// generated by codegen, remove this comment if you wish to edit this file
21
/**
32
* This module provides a hand-modifiable wrapper around the generated class `NotNull`.
43
*
@@ -12,6 +11,7 @@ private import codeql.rust.elements.internal.generated.NotNull
1211
* be referenced directly.
1312
*/
1413
module Impl {
14+
// the following QLdoc is generated: if you need to edit it, do it in the schema file
1515
/**
1616
* The `!null` pattern used in a pattern type to denote a non-null value. Pattern types
1717
* are an experimental, mostly compiler-internal feature (used in the standard library for
@@ -21,5 +21,7 @@ module Impl {
2121
* type NonNull = builtin#pattern_type(*const () is !null);
2222
* ```
2323
*/
24-
class NotNull extends Generated::NotNull { }
24+
class NotNull extends Generated::NotNull {
25+
override string toStringImpl() { result = this.getAPrimaryQlClass() }
26+
}
2527
}

rust/ql/lib/codeql/rust/elements/internal/PatternTypeReprImpl.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// generated by codegen, remove this comment if you wish to edit this file
21
/**
32
* This module provides a hand-modifiable wrapper around the generated class `PatternTypeRepr`.
43
*
@@ -12,6 +11,7 @@ private import codeql.rust.elements.internal.generated.PatternTypeRepr
1211
* be referenced directly.
1312
*/
1413
module Impl {
14+
// the following QLdoc is generated: if you need to edit it, do it in the schema file
1515
/**
1616
* A pattern type, constraining a type to values matching a pattern. Pattern types are an
1717
* experimental, mostly compiler-internal feature and cannot be written directly in stable
@@ -20,5 +20,7 @@ module Impl {
2020
* type NonZero = builtin#pattern_type(u32 is 1..);
2121
* ```
2222
*/
23-
class PatternTypeRepr extends Generated::PatternTypeRepr { }
23+
class PatternTypeRepr extends Generated::PatternTypeRepr {
24+
override string toStringImpl() { result = this.getAPrimaryQlClass() }
25+
}
2426
}

rust/ql/lib/codeql/rust/elements/internal/VisibilityInnerImpl.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// generated by codegen, remove this comment if you wish to edit this file
21
/**
32
* This module provides a hand-modifiable wrapper around the generated class `VisibilityInner`.
43
*
@@ -12,12 +11,15 @@ private import codeql.rust.elements.internal.generated.VisibilityInner
1211
* be referenced directly.
1312
*/
1413
module Impl {
14+
// the following QLdoc is generated: if you need to edit it, do it in the schema file
1515
/**
1616
* The parenthesized inner part of a visibility modifier or restriction, such as the `(in path)` in `pub(in path)`, or the `(crate)` in `pub(crate)`. For example the `(in foo::bar)` in:
1717
* ```rust
1818
* pub(in foo::bar) struct S;
1919
* // ^^^^^^^^^^^^
2020
* ```
2121
*/
22-
class VisibilityInner extends Generated::VisibilityInner { }
22+
class VisibilityInner extends Generated::VisibilityInner {
23+
override string toStringImpl() { result = this.getAPrimaryQlClass() }
24+
}
2325
}

0 commit comments

Comments
 (0)