Commit Graph

1223 Commits

Author SHA1 Message Date
Tom Hvitved
433756debb Rust: Make SummarizedCallable extend Function instead of string 2025-06-17 14:12:38 +02:00
Simon Friis Vindum
f18acdf11f Rust: Generalize type of debug predicate 2025-06-17 10:34:42 +02:00
Simon Friis Vindum
a0bc455d53 Rust: Account for borrows in operators in type inference 2025-06-17 10:34:41 +02:00
Simon Friis Vindum
ebdffcc4ef Rust: Refactor and generalize Call 2025-06-17 10:34:38 +02:00
Tom Hvitved
631b14a0df Rust: Fix three models 2025-06-16 14:28:06 +02:00
Simon Friis Vindum
8fe737ca52 Rust: Use defaults for type parameters 2025-06-16 09:54:01 +02:00
Simon Friis Vindum
38aacb04c2 Rust: Add debug predicate for type mentions 2025-06-16 09:52:42 +02:00
Paolo Tranquilli
2a51749a31 Merge pull request #19748 from github/redsun82/rust-models
Rust: regenerate models
2025-06-16 08:37:00 +02:00
Simon Friis Vindum
ef15df35c6 Rust: Apply review suggestions 2025-06-13 15:43:44 +02:00
Simon Friis Vindum
eacf034dde Rust: Disambiguate some method calls based on argument types 2025-06-13 15:43:39 +02:00
Tom Hvitved
6cca01662d Merge pull request #19755 from hvitved/rust/type-inference-operand-workaround
Rust: Temporarily disable type information to flow into operands
2025-06-13 15:25:34 +02:00
Tom Hvitved
5f4d588cd9 Rust: Temporarily disable type information to flow into operands 2025-06-13 14:21:02 +02:00
Tom Hvitved
2f698d1590 Rust: Type inference for macro expressions 2025-06-13 13:11:11 +02:00
Tom Hvitved
ad64e04475 Merge pull request #19737 from hvitved/rust/type-inference-string-str-deref
Rust: Model `String` -> `str` implicit conversion in type inference
2025-06-13 13:09:24 +02:00
Paolo Tranquilli
ad3a5d777d Rust: add public preview change notes 2025-06-13 13:03:39 +02:00
Tom Hvitved
66c0ff61bb Rust: Model String -> str implicit conversion in type inference 2025-06-13 11:32:23 +02:00
Paolo Tranquilli
118456d127 Rust: regenerate models
Models are regenerated with the fix from https://github.com/github/codeql/pull/19744
which corrects the order of generation.
2025-06-13 09:06:15 +02:00
Tom Hvitved
3d18e3ea8f Rust: Use hasImplementation in path resolution 2025-06-13 08:44:44 +02:00
Paolo Tranquilli
22c490ce4e Merge pull request #19667 from github/redsun82/rust-mad
Rust: Use QL computed canonical paths in MaD `Field` tokens
2025-06-12 20:48:41 +02:00
Paolo Tranquilli
a5dba9b54f Merge pull request #19649 from github/redsun82/rust-has-implementation
Rust: extract `hasImplementation` on functions and consts
2025-06-12 15:19:23 +00:00
Simon Friis Vindum
e30a9e9906 Merge pull request #19685 from paldepind/rust/df-operator-overloading
Rust: Data flow through overloaded operators
2025-06-12 17:08:16 +02:00
Paolo Tranquilli
836b81de40 Rust: fix mdoel 2025-06-12 15:50:21 +02:00
Paolo Tranquilli
506ea11d07 Rust: simplify upgrade script 2025-06-12 15:31:11 +02:00
Paolo Tranquilli
ad7fb9c061 Merge branch 'main' into redsun82/rust-has-implementation 2025-06-12 15:25:59 +02:00
Simon Friis Vindum
2dd2f2e72b Rust: Address review comments 2025-06-12 14:12:27 +02:00
Tom Hvitved
9e6ce98491 Merge pull request #19728 from hvitved/rust/type-inference-debug-predicates
Rust: Add another type inference debug predicate
2025-06-12 12:15:19 +02:00
Simon Friis Vindum
8cde1eefb2 Rust: Remove Access from adjustAccessType 2025-06-12 11:16:32 +02:00
Simon Friis Vindum
f138f77cc1 Rust: Only adjust access type for method call expressions 2025-06-12 11:16:30 +02:00
Simon Friis Vindum
03c9a78bfb Rust: Simplify accessDeclarationPositionMatch 2025-06-12 11:16:29 +02:00
Simon Friis Vindum
3463ebd8ce Rust: Adapt data flow consistency queries to ! being a call
The exact same problem occurs in Ruby, hence the `multipleArgumentCallExclude` implementation is adapted from Ruby's.
2025-06-12 11:16:28 +02:00
Simon Friis Vindum
fecd445e78 Rust: Use Call in data flow 2025-06-12 11:16:26 +02:00
Simon Friis Vindum
5642445e1d Rust: Fix canonical path for Deref trait 2025-06-12 11:16:25 +02:00
Simon Friis Vindum
7684e01c3a Rust: Use Call in type inference 2025-06-12 11:16:19 +02:00
Simon Friis Vindum
47864781c1 Rust: Add abstraction over all kinds of calls 2025-06-12 11:12:06 +02:00
Simon Friis Vindum
ce1c9fbec1 Rust: Account for arity in operator overloading
For instance the binary `&` is overloadable but the prefix `&` is not. Similarly, `*` has a different target depending on if it's prefix or infix.
2025-06-12 11:12:04 +02:00
Tom Hvitved
d667f7d411 Merge pull request #19732 from hvitved/rust/builtin-canonical-paths
Rust: Generate canonical paths for builtins
2025-06-12 10:47:00 +02:00
Tom Hvitved
649481e279 Merge pull request #19657 from hvitved/rust/type-inference-index-expr-simple
Rust: Simple type inference for index expressions
2025-06-12 10:27:09 +02:00
Geoffrey White
fdf1dca28f Merge pull request #19735 from geoffw0/canonical
Rust: Update RegexInjectionExtensions to use getCanonicalPath.
2025-06-12 09:14:52 +01:00
Paolo Tranquilli
326ddd6625 Merge branch 'main' into redsun82/rust-mad 2025-06-12 09:24:44 +02:00
Tom Hvitved
383cc5c2a7 Rust: Rename Bultins.qll -> Builtins.qll 2025-06-12 09:12:32 +02:00
Tom Hvitved
69e549f400 Rust: Generate canonical paths for builtins 2025-06-11 21:14:56 +02:00
Paolo Tranquilli
bea5381420 Rust: replace last hand-written instances of Field[crate:: 2025-06-11 16:48:39 +02:00
Paolo Tranquilli
051704e59d Merge branch 'main' into redsun82/rust-mad 2025-06-11 16:39:10 +02:00
Geoffrey White
0c05fa48eb Rust: Update RegexInjectionExtensions to use getCanonicalPath. 2025-06-11 15:32:23 +01:00
Tom Hvitved
31770edc26 Merge pull request #19725 from hvitved/rust/fix-bad-joins
Rust: Fix various bad joins
2025-06-11 14:51:20 +02:00
Tom Hvitved
133aca0773 Rust: Simple type inference for index expressions 2025-06-11 13:15:21 +02:00
Tom Hvitved
9f8a3abcff Rust: Add another type inference debug predicate 2025-06-11 12:44:17 +02:00
Simon Friis Vindum
75caa182f5 Merge pull request #19724 from github/rust/type-inference-borrow
Rust: Implement type inference for ref expression as type equality
2025-06-11 12:36:43 +02:00
Paolo Tranquilli
fbcd9eaf09 Merge pull request #19674 from github/redsun82/mad
Rust: regenerate MaD files using DCA
2025-06-11 11:10:08 +02:00
Tom Hvitved
8c956647de Rust: Fix bad join in fileImport
Before
```
Evaluated relational algebra for predicate PathResolution::fileImport/2#d9e57816@c790f609 with tuple counts:
           241   ~0%    {3} r1 = JOIN `_Locatable::Locatable.getFile/0#dispred#f7e24934_PathResolution::isSourceFile/1#803de032#shared` WITH `FileSystem::Folder::Append<PathResolution::shouldAppend>::append/2#beb8f79a_201#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Rhs.2, Lhs.1
           291   ~0%    {2}    | JOIN WITH `PathResolution::pathAttrImport/3#88463ffa_021#join_rhs` ON FIRST 2 OUTPUT Rhs.2, Lhs.2

         14978   ~8%    {2} r2 = SCAN `PathResolution::modImport0/3#03cccf2a` OUTPUT In.0, In.1
         14978   ~8%    {2}    | STREAM DEDUP

         14392   ~9%    {2} r3 = r2 AND NOT `PathResolution::modImportNested/3#991244df_0#antijoin_rhs`(FIRST 1)
         14392   ~0%    {3}    | JOIN WITH `PathResolution::modImport0/3#03cccf2a` ON FIRST 2 OUTPUT Lhs.1, Rhs.2, Lhs.0
         14355   ~0%    {4}    | JOIN WITH `PathResolution::fileModule/3#d6c6ceef#fbf_120#join_rhs` ON FIRST 2 OUTPUT Rhs.2, Lhs.0, Lhs.1, Lhs.2

         14978   ~0%    {2} r4 = JOIN r2 WITH `PathResolution::modImport0/3#03cccf2a` ON FIRST 2 OUTPUT Lhs.1, Lhs.0
        329862   ~0%    {5}    | JOIN WITH `PathResolution::fileModule/3#d6c6ceef#fbf_102#join_rhs` ON FIRST 1 OUTPUT Lhs.1, Lhs.1, Rhs.2, Lhs.0, Rhs.1
           577   ~3%    {4}    | JOIN WITH `PathResolution::modImportNestedLookup/3#6cc4b913#ffb` ON FIRST 3 OUTPUT Lhs.4, Lhs.3, Lhs.2, Lhs.0

         14932   ~0%    {4} r5 = r3 UNION r4
         14932   ~0%    {2}    | JOIN WITH `PathResolution::fileModule/3#d6c6ceef#fbf` ON FIRST 3 OUTPUT Lhs.0, Lhs.3
         14932   ~0%    {2}    | JOIN WITH `PathResolution::isSourceFile/1#803de032` ON FIRST 1 OUTPUT Lhs.1, Lhs.0

         15223   ~0%    {2} r6 = r1 UNION r5
                        return r6
```

Afer
```
Evaluated relational algebra for predicate PathResolution::fileImport/2#d9e57816@007bd81i with tuple counts:
          241   ~0%    {3} r1 = JOIN `_Locatable::Locatable.getFile/0#dispred#f7e24934_PathResolution::isSourceFile/1#803de032#shared` WITH `FileSystem::Folder::Append<PathResolution::shouldAppend>::append/2#beb8f79a_201#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Rhs.2, Lhs.1
          291   ~0%    {2}    | JOIN WITH `PathResolution::pathAttrImport/3#88463ffa_021#join_rhs` ON FIRST 2 OUTPUT Rhs.2, Lhs.2

        14978   ~8%    {2} r2 = SCAN `PathResolution::modImport0/3#03cccf2a` OUTPUT In.0, In.1
        14978   ~8%    {2}    | STREAM DEDUP

        14392   ~9%    {2} r3 = r2 AND NOT `PathResolution::modImportNested/3#991244df_0#antijoin_rhs`(FIRST 1)
        14392   ~0%    {3}    | JOIN WITH `PathResolution::modImport0/3#03cccf2a` ON FIRST 2 OUTPUT Lhs.1, Rhs.2, Lhs.0

        14978   ~9%    {3} r4 = JOIN r2 WITH `PathResolution::modImport0/3#03cccf2a` ON FIRST 2 OUTPUT Lhs.0, Lhs.0, Lhs.1
          577   ~0%    {3}    | JOIN WITH `PathResolution::modImportNestedLookup/3#6cc4b913#ffb` ON FIRST 2 OUTPUT Lhs.2, Rhs.2, Lhs.0

        14969   ~1%    {3} r5 = r3 UNION r4
        14932   ~0%    {2}    | JOIN WITH `PathResolution::fileModule/3#d6c6ceef_120#join_rhs` ON FIRST 2 OUTPUT Rhs.2, Lhs.2
        14932   ~0%    {2}    | JOIN WITH `PathResolution::isSourceFile/1#803de032` ON FIRST 1 OUTPUT Lhs.1, Lhs.0

        15223   ~0%    {2} r6 = r1 UNION r5
                       return r6
```
2025-06-11 09:15:14 +02:00