Commit Graph

3391 Commits

Author SHA1 Message Date
Geoffrey White
6433bec699 Rust: Add a test for BuiltinTypes. 2025-10-31 16:24:51 +00:00
Geoffrey White
47019f7f24 Rust: Define NumericType, IntegralType and FloatingPointType in Builtins.qll. 2025-10-31 16:24:39 +00:00
Geoffrey White
aaa3b1bcb4 Rust: Add a couple of new test cases. 2025-10-31 16:20:52 +00:00
Simon Friis Vindum
c648aa69b8 Rust: Rename predicates 2025-10-30 14:35:17 +01:00
Simon Friis Vindum
b189f1fe3f Rust: Refactor using shared constraint satisfaction 2025-10-30 08:18:12 +01:00
Tom Hvitved
6ed8bcbcf3 Rust: Add type inference tests for method resolution overlap 2025-10-29 14:53:28 +01:00
Tom Hvitved
e5f1238e26 Merge pull request #20707 from paldepind/rust/ti-self-trait
Rust: Improve handling of `Self` type parameter
2025-10-29 13:17:14 +01:00
Geoffrey White
558ca74e9c Merge pull request #20702 from geoffw0/gen2
Rust: Generalize more models
2025-10-29 11:32:00 +00:00
Simon Friis Vindum
ce8cffc331 Rust: Address comments 2025-10-29 11:18:02 +01:00
Tom Hvitved
b7293541cd Merge pull request #20704 from hvitved/rust/fix-bad-joins
Rust: Fix two bad joins
2025-10-29 11:11:54 +01:00
Simon Friis Vindum
9022f996e8 Rust: Improve handling of occurrences of the Self type parameter 2025-10-29 10:41:46 +01:00
Simon Friis Vindum
9ff3c61c6e Rust: Add type inference tests involving Self 2025-10-29 10:41:44 +01:00
Tom Hvitved
f2380d3ef1 Merge pull request #20612 from hvitved/rust/type-inference-blanket-non-satisfaction
Rust: Compute incompatible blanket implementations
2025-10-28 14:00:55 +01:00
Tom Hvitved
104ba0e291 Rust: Fix bad join
Before
```
Pipeline standard for TypeInference::MethodCallMatching::AccessConstraint::RelevantAccess.getTypeAt/1#dispred#e8abf748@ada3a07w was evaluated in 801 iterations totaling 31ms (delta sizes total: 182871).
           50151   ~1%    {4} r1 = SCAN TypeInference::MethodCallMatching::AccessConstraint::MkRelevantAccess#7a01048b#prev_delta OUTPUT In.0, In.2, In.3, In.4
           39574   ~0%    {5}    | JOIN WITH `TypeInference::MethodCallMatchingInput::Access.getInferredNonSelfType/2#dispred#b181cb0a#prev` ON FIRST 2 OUTPUT Lhs.3, Rhs.3, _, Lhs.2, Rhs.2
                          {3}    | REWRITE WITH Tmp.2 := "", Out.2 := InverseAppend(In.3,Tmp.2,In.4) KEEPING 3
           36996   ~0%    {3}    | SCAN OUTPUT In.0, In.2, In.1

        36102333   ~0%    {4} r2 = SCAN TypeInference::MethodCallMatching::AccessConstraint::MkRelevantAccess#7a01048b#prev OUTPUT In.0, In.2, In.3, In.4
           90175   ~1%    {5}    | JOIN WITH `TypeInference::MethodCallMatchingInput::Access.getInferredNonSelfType/2#dispred#b181cb0a#prev_delta` ON FIRST 2 OUTPUT Lhs.3, Rhs.3, _, Lhs.2, Rhs.2
                          {3}    | REWRITE WITH Tmp.2 := "", Out.2 := InverseAppend(In.3,Tmp.2,In.4) KEEPING 3
           65014   ~1%    {3}    | SCAN OUTPUT In.0, In.2, In.1

           50151   ~1%    {5} r3 = SCAN TypeInference::MethodCallMatching::AccessConstraint::MkRelevantAccess#7a01048b#prev_delta OUTPUT In.2, In.0, In.1, In.3, In.4
           24208   ~1%    {4}    | JOIN WITH `FunctionType::FunctionPosition.isSelf/0#dispred#9e84d302` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Lhs.3, Lhs.4
           95022   ~0%    {9}    | JOIN WITH `TypeInference::MethodCallMatchingInput::Access.getInferredSelfType/3#dispred#45b2f893#prev` ON FIRST 1 OUTPUT Lhs.2, Lhs.3, Rhs.2, Rhs.3, Rhs.4, _, Rhs.1, Lhs.1, _
                          {6}    | REWRITE WITH Tmp.5 := ";", Tmp.5 := (In.6 ++ Tmp.5), Tmp.8 := "", Out.5 := InverseAppend(Tmp.5,Tmp.8,In.7) KEEPING 6
           93919   ~1%    {7}    | SCAN OUTPUT In.0, In.1, In.2, In.3, In.4, In.5, _
                          {6}    | REWRITE WITH NOT [NOT [Tmp.6 := "borrow", TEST InOut.5 = Tmp.6, Tmp.6 := true, TEST InOut.2 = Tmp.6], NOT [Tmp.6 := "", TEST InOut.5 = Tmp.6, Tmp.6 := true, TEST InOut.2 != Tmp.6]] KEEPING 6
           81298   ~1%    {5}    | SCAN OUTPUT In.1, In.4, _, In.0, In.3
                          {3}    | REWRITE WITH Tmp.2 := "", Out.2 := InverseAppend(In.3,Tmp.2,In.4) KEEPING 3
           64110   ~1%    {3}    | SCAN OUTPUT In.0, In.2, In.1

        36102333   ~0%    {5} r4 = SCAN TypeInference::MethodCallMatching::AccessConstraint::MkRelevantAccess#7a01048b#prev OUTPUT In.2, In.0, In.1, In.3, In.4
        17473531   ~0%    {4}    | JOIN WITH `FunctionType::FunctionPosition.isSelf/0#dispred#9e84d302` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Lhs.3, Lhs.4
           47409   ~1%    {9}    | JOIN WITH `TypeInference::MethodCallMatchingInput::Access.getInferredSelfType/3#dispred#45b2f893#prev_delta` ON FIRST 1 OUTPUT Lhs.2, Lhs.3, Rhs.2, Rhs.3, Rhs.4, _, Rhs.1, Lhs.1, _
                          {6}    | REWRITE WITH Tmp.5 := ";", Tmp.5 := (In.6 ++ Tmp.5), Tmp.8 := "", Out.5 := InverseAppend(Tmp.5,Tmp.8,In.7) KEEPING 6
           29885   ~0%    {7}    | SCAN OUTPUT In.0, In.1, In.2, In.3, In.4, In.5, _
                          {6}    | REWRITE WITH NOT [NOT [Tmp.6 := "borrow", TEST InOut.5 = Tmp.6, Tmp.6 := true, TEST InOut.2 = Tmp.6], NOT [Tmp.6 := "", TEST InOut.5 = Tmp.6, Tmp.6 := true, TEST InOut.2 != Tmp.6]] KEEPING 6
           16952   ~1%    {5}    | SCAN OUTPUT In.1, In.4, _, In.0, In.3
                          {3}    | REWRITE WITH Tmp.2 := "", Out.2 := InverseAppend(In.3,Tmp.2,In.4) KEEPING 3
           16829   ~0%    {3}    | SCAN OUTPUT In.0, In.2, In.1

          182949   ~1%    {3} r5 = r1 UNION r2 UNION r3 UNION r4
          182949   ~1%    {3}    | AND NOT `TypeInference::MethodCallMatching::AccessConstraint::RelevantAccess.getTypeAt/1#dispred#e8abf748#prev`(FIRST 3)
                          return r5
```

After
```
Pipeline standard for TypeInference::MethodCallMatching::AccessConstraint::RelevantAccess.getTypeAt/1#dispred#e8abf748@31ee547w was evaluated in 801 iterations totaling 19ms (delta sizes total: 182946).
         81298   ~0%    {5} r1 = JOIN TypeInference::MethodCallMatching::AccessConstraint::MkRelevantAccess#7a01048b#prev_delta WITH `TypeInference::MethodCallMatchingInput::Access.getInferredSelfType/3#dispred#45b2f893#prev` ON FIRST 3 OUTPUT Lhs.4, Rhs.4, _, Lhs.3, Rhs.3
                        {3}    | REWRITE WITH Tmp.2 := "", Out.2 := InverseAppend(In.3,Tmp.2,In.4) KEEPING 3
         64110   ~1%    {3}    | SCAN OUTPUT In.0, In.2, In.1

         39574   ~0%    {5} r2 = JOIN TypeInference::MethodCallMatching::AccessConstraint::MkRelevantAccess#7a01048b#prev_delta WITH `TypeInference::MethodCallMatchingInput::Access.getInferredNonSelfType/2#dispred#b181cb0a#prev` ON FIRST 2 OUTPUT Lhs.4, Rhs.3, _, Lhs.3, Rhs.2
                        {3}    | REWRITE WITH Tmp.2 := "", Out.2 := InverseAppend(In.3,Tmp.2,In.4) KEEPING 3
         36996   ~0%    {3}    | SCAN OUTPUT In.0, In.2, In.1

         16952   ~0%    {5} r3 = JOIN TypeInference::MethodCallMatching::AccessConstraint::MkRelevantAccess#7a01048b#prev WITH `TypeInference::MethodCallMatchingInput::Access.getInferredSelfType/3#dispred#45b2f893#prev_delta` ON FIRST 3 OUTPUT Lhs.4, Rhs.4, _, Lhs.3, Rhs.3
                        {3}    | REWRITE WITH Tmp.2 := "", Out.2 := InverseAppend(In.3,Tmp.2,In.4) KEEPING 3
         16829   ~0%    {3}    | SCAN OUTPUT In.0, In.2, In.1

         90175   ~0%    {5} r4 = JOIN TypeInference::MethodCallMatching::AccessConstraint::MkRelevantAccess#7a01048b#prev WITH `TypeInference::MethodCallMatchingInput::Access.getInferredNonSelfType/2#dispred#b181cb0a#prev_delta` ON FIRST 2 OUTPUT Lhs.4, Rhs.3, _, Lhs.3, Rhs.2
                        {3}    | REWRITE WITH Tmp.2 := "", Out.2 := InverseAppend(In.3,Tmp.2,In.4) KEEPING 3
         65014   ~0%    {3}    | SCAN OUTPUT In.0, In.2, In.1

        182949   ~1%    {3} r5 = r1 UNION r2 UNION r3 UNION r4
        182949   ~1%    {3}    | AND NOT `TypeInference::MethodCallMatching::AccessConstraint::RelevantAccess.getTypeAt/1#dispred#e8abf748#prev`(FIRST 3)
                        return r5
```
2025-10-28 13:09:32 +01:00
Tom Hvitved
409f7fb743 Address review comments 2025-10-28 11:48:45 +01:00
Geoffrey White
abcc1712d5 Rust: Remove more redundant models. 2025-10-28 09:26:11 +00:00
Nora Dimitrijević
8e0c453c37 Rust/InsecureCookie 2025-10-28 09:42:14 +01:00
Nora Dimitrijević
4952cb27fb Rust/AccessAfterLifetime 2025-10-28 09:42:11 +01:00
Geoffrey White
b76f27d10b Rust: Remove redundant model. 2025-10-27 18:47:17 +00:00
Geoffrey White
03204b7881 Rust: Accept tests repaired. 2025-10-27 17:53:40 +00:00
Geoffrey White
0c92b33b8f Revert "Rust: Generalize more models."
This reverts commit 56811d02ac.
2025-10-27 17:47:00 +00:00
Geoffrey White
a468b1d647 Rust: Accept regressions spotted by CI. 2025-10-27 17:46:01 +00:00
Geoffrey White
56811d02ac Rust: Generalize more models. 2025-10-27 14:11:09 +00:00
Geoffrey White
bd11873e0d Rust: Generalize a model of futures_io...poll_read. 2025-10-27 12:22:13 +00:00
Geoffrey White
c8b8046302 Rust: Generalize a model of alloc::boxed::Box. 2025-10-27 12:09:05 +00:00
Geoffrey White
d650ccb74b Rust: Generalize some std::io::Read models. 2025-10-27 12:09:04 +00:00
Tom Hvitved
0e885e9297 Rust: Compute incompatible blanket implementations 2025-10-24 11:37:24 +02:00
Tom Hvitved
2a43a95049 Rust: More type inference tests 2025-10-24 11:37:22 +02:00
Tom Hvitved
672977acfa Merge pull request #20592 from hvitved/rust/type-inference-branch-propagation
Rust: Non-symmetric type propagation for lub coercions
2025-10-24 11:35:24 +02:00
Tom Hvitved
ff31f0e3df Address review comments 2025-10-23 20:17:28 +02:00
Geoffrey White
7acd214d7b Merge pull request #20673 from geoffw0/sourcestest
Rust: Split up the dataflow/sources test
2025-10-23 13:08:43 +01:00
Geoffrey White
47334fbab7 Rust: Accept changes to the web_frameworks results. 2025-10-23 09:06:11 +01:00
Tom Hvitved
65b706ab80 Rust: Non-symmetric type propagation for lub coercions 2025-10-22 19:57:38 +02:00
Tom Hvitved
00bf049c85 Rust: Add more type inference tests 2025-10-22 19:57:37 +02:00
Tom Hvitved
c84cec9d29 Merge pull request #20664 from hvitved/rust/callable-get-body
Rust: Add `Callable.getBody()`
2025-10-22 19:57:14 +02:00
Geoffrey White
e18bf1661a Rust: Accept result de-regression. 2025-10-22 17:52:12 +01:00
Geoffrey White
6b08297c2a Rust: Repair after merge. 2025-10-22 17:46:25 +01:00
Geoffrey White
bc4d8a8425 Merge branch 'main' into sourcestest 2025-10-22 17:31:25 +01:00
Geoffrey White
5d2ddbfa8e Merge pull request #20670 from geoffw0/missingmetric
Rust: Add expressions with known type metric
2025-10-22 15:42:48 +01:00
Tom Hvitved
4b6c39004f Rust: Add DB downgrade script 2025-10-22 16:40:56 +02:00
Tom Hvitved
8b10f68e28 Rust: Add DB upgrade scripts 2025-10-22 16:40:54 +02:00
Tom Hvitved
944ebc5267 Rust: Add Callable.getBody() 2025-10-22 16:40:53 +02:00
Tom Hvitved
cf05414a93 Address review comments (iv) 2025-10-22 15:29:57 +02:00
Geoffrey White
6878a43223 Rust: Add missing file. 2025-10-22 14:18:16 +01:00
Geoffrey White
8336a956c0 Rust: Add consistency check failures. 2025-10-22 13:50:49 +01:00
Tom Hvitved
2cc8b7f6dd Address review comments (iii) 2025-10-22 11:07:20 +02:00
Geoffrey White
9b11ec53d4 Rust: Merge InlineFlow.ql test queries using .qlrefs. 2025-10-22 09:02:18 +01:00
Geoffrey White
4893f53607 Rust: Fix a comment. 2025-10-22 09:02:15 +01:00
Geoffrey White
42224fe642 Rust: Clean up the sources test directory. 2025-10-22 09:02:14 +01:00
Geoffrey White
7efd4d26a0 Rust: Accept result regression.
Presumably because of a change in context, e.g. the module wrapping
this test now, or the different inputs.  Either way we *should* be
able to get the result, and what we *actually* get in our analysis
doesn't change here either.  We've just slightly changed the test
and exposed a gap.
2025-10-22 09:02:12 +01:00