Rust: Rename classes with Record to Struct

This commit is contained in:
Simon Friis Vindum
2025-03-19 10:37:10 +01:00
parent 179bae8791
commit b2b650ddd3
155 changed files with 1968 additions and 1933 deletions

View File

@@ -0,0 +1,2 @@
| gen_struct_pat_field.rs:5:15:5:18 | a: 1 | getNumberOfAttrs: | 0 | hasNameRef: | yes | hasPat: | yes |
| gen_struct_pat_field.rs:5:21:5:24 | b: 2 | getNumberOfAttrs: | 0 | hasNameRef: | yes | hasPat: | yes |

View File

@@ -0,0 +1,12 @@
// generated by codegen, do not edit
import codeql.rust.elements
import TestUtils
from StructPatField x, int getNumberOfAttrs, string hasNameRef, string hasPat
where
toBeTested(x) and
not x.isUnknown() and
getNumberOfAttrs = x.getNumberOfAttrs() and
(if x.hasNameRef() then hasNameRef = "yes" else hasNameRef = "no") and
if x.hasPat() then hasPat = "yes" else hasPat = "no"
select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasNameRef:", hasNameRef, "hasPat:", hasPat

View File

@@ -0,0 +1,7 @@
// generated by codegen, do not edit
import codeql.rust.elements
import TestUtils
from StructPatField x, int index
where toBeTested(x) and not x.isUnknown()
select x, index, x.getAttr(index)

View File

@@ -0,0 +1,2 @@
| gen_struct_pat_field.rs:5:15:5:18 | a: 1 | gen_struct_pat_field.rs:5:15:5:15 | a |
| gen_struct_pat_field.rs:5:21:5:24 | b: 2 | gen_struct_pat_field.rs:5:21:5:21 | b |

View File

@@ -0,0 +1,7 @@
// generated by codegen, do not edit
import codeql.rust.elements
import TestUtils
from StructPatField x
where toBeTested(x) and not x.isUnknown()
select x, x.getNameRef()

View File

@@ -0,0 +1,2 @@
| gen_struct_pat_field.rs:5:15:5:18 | a: 1 | gen_struct_pat_field.rs:5:18:5:18 | 1 |
| gen_struct_pat_field.rs:5:21:5:24 | b: 2 | gen_struct_pat_field.rs:5:24:5:24 | 2 |

View File

@@ -0,0 +1,7 @@
// generated by codegen, do not edit
import codeql.rust.elements
import TestUtils
from StructPatField x
where toBeTested(x) and not x.isUnknown()
select x, x.getPat()

View File

@@ -0,0 +1,6 @@
// generated by codegen, do not edit
fn test_struct_pat_field() -> () {
// A field in a struct pattern. For example `a: 1` in:
let Foo { a: 1, b: 2 } = foo;
}