Skip to content

Conversation

@hvitved
Copy link
Contributor

@hvitved hvitved commented Dec 8, 2025

No description provided.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Dec 8, 2025
Comment on lines 265 to 296
/**
* Index assignments like `a[i] = rhs` are treated as `*a.index_mut(i) = rhs`,
* so they should in principle be handled by `referenceAssignment`.
*
* However, this would require support for [generalized reverse flow][1], which
* is not yet implemented, so instead we simulate reverse flow where it would
* have applied via the model for `<_ as core::ops::index::IndexMut>::index_mut`.
*
* The same is the case for compound assignments like `a[i] += rhs`, which are
* treated as `(*a.index_mut(i)).add_assign(rhs)`.
*
* [1]: https://github.com/github/codeql/pull/18109
*/

Check warning

Code scanning / CodeQL

Predicate QLDoc style Warning

The QLDoc for a predicate without a result should start with 'Holds'.
@hvitved hvitved force-pushed the rust/type-inference-deref-trait branch 3 times, most recently from baba061 to 5dda9be Compare December 15, 2025 09:17
@hvitved hvitved force-pushed the rust/type-inference-deref-trait branch 2 times, most recently from eb1db27 to e269016 Compare December 16, 2025 13:44
pragma[nomagic]
Type getACandidateReceiverTypeAtSubstituteLookupTraits(
string derefChain, boolean borrow, TypePath path
Type getANonPseudoCandidateReceiverTypeAt(

Check warning

Code scanning / CodeQL

Missing QLDoc for parameter Warning

The QLDoc has no documentation for borrow, or derefChain, or path, but the QLDoc mentions unknown
@hvitved hvitved force-pushed the rust/type-inference-deref-trait branch from 8266451 to 14037e4 Compare December 16, 2025 14:38
@hvitved hvitved force-pushed the rust/type-inference-deref-trait branch from 14037e4 to 0c7b1d0 Compare December 17, 2025 10:42
)
)
}

Check warning

Code scanning / CodeQL

Omittable 'exists' variable Warning

This exists variable can be omitted by using a don't-care expression
in this argument
.
@hvitved hvitved force-pushed the rust/type-inference-deref-trait branch 2 times, most recently from 7880183 to be3a16a Compare December 17, 2025 12:40
@hvitved hvitved force-pushed the rust/type-inference-deref-trait branch 6 times, most recently from cc413c1 to adcbfc8 Compare December 18, 2025 13:42
string toString() {
result = this.asCall().toString()
or
exists(AstNode n, DerefChain derefChain, int i, Function target |

Check warning

Code scanning / CodeQL

Omittable 'exists' variable Warning

This exists variable can be omitted by using a don't-care expression
in this argument
.
@hvitved hvitved force-pushed the rust/type-inference-deref-trait branch from dd62164 to dc0c45b Compare December 18, 2025 16:18
@hvitved hvitved force-pushed the rust/type-inference-deref-trait branch 4 times, most recently from f3bad27 to c23d528 Compare December 19, 2025 15:02
@hvitved hvitved changed the title Rust: Handle Deref trait in type inference Rust: Handle Deref trait in type inference and data flow Dec 19, 2025
@hvitved hvitved force-pushed the rust/type-inference-deref-trait branch from c23d528 to 76ad749 Compare December 19, 2025 18:44
Before
```
Pipeline standard for AccessAfterLifetimeExtensions::AccessAfterLifetime::mayEncloseOnStack/2#3cdefece#bf@61cb32j5 was evaluated in 30 iterations totaling 44856ms (delta sizes total: 241646328).
         241404616     ~1%    {2} r1 = SCAN `AccessAfterLifetimeExtensions::AccessAfterLifetime::mayEncloseOnStack/2#3cdefece#bf#prev_delta` OUTPUT In.1, In.0
        7379161442  ~1080%    {2}    | JOIN WITH `_AstNode::AstNode.getEnclosingBlock/0#5c38e65a_AstNode::AstNode.getEnclosingCallable/0#5a548913_Bloc__#join_rhs` ON FIRST 1 OUTPUT Lhs.1, Rhs.1
         333897324    ~40%    {2}    | AND NOT `AccessAfterLifetimeExtensions::AccessAfterLifetime::mayEncloseOnStack/2#3cdefece#bf#prev`(FIRST 2)
         297961888    ~24%    {2}    | JOIN WITH `project#AccessAfterLifetimeExtensions::AccessAfterLifetime::sourceValueScope/3#d065ba16#2` ON FIRST 1 OUTPUT Lhs.0, Lhs.1
                              return r1
```
@hvitved hvitved force-pushed the rust/type-inference-deref-trait branch from 76ad749 to 2927d7d Compare January 5, 2026 09:40
@hvitved hvitved force-pushed the rust/type-inference-deref-trait branch 2 times, most recently from 60d9084 to de3a73e Compare January 5, 2026 13:25
@hvitved hvitved force-pushed the rust/type-inference-deref-trait branch from de3a73e to 5c70ae0 Compare January 5, 2026 13:47
@hvitved hvitved force-pushed the rust/type-inference-deref-trait branch from 5c70ae0 to 20ebba3 Compare January 5, 2026 14:04
}

private class ImplicitDerefOutNode extends ImplicitDerefNode, OutNode {
private DataFlowCall call;

Check warning

Code scanning / CodeQL

Dead code Warning

This code is never used, and it's not publicly exported.
@hvitved hvitved force-pushed the rust/type-inference-deref-trait branch from 7d31e0b to 0c7f4c4 Compare January 5, 2026 19:21
@hvitved hvitved force-pushed the rust/type-inference-deref-trait branch from 0c7f4c4 to f63ac8f Compare January 5, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant