Skip to content

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Aug 25, 2025

No description provided.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Aug 25, 2025
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@hvitved hvitved force-pushed the rust/type-inference-method-call-resolution-rework branch 2 times, most recently from e4cfb86 to 4a8c37c Compare August 26, 2025 18:30
@hvitved hvitved force-pushed the rust/type-inference-method-call-resolution-rework branch from 4a8c37c to e75d79e Compare August 27, 2025 15:34

/**
* Holds if `constraint` might occur as the third argument of
* `potentialInstantiationOf`. Defaults to simply projecting the third
* argument of `potentialInstantiationOf`.
*/
default predicate relevantTypeMention(TypeMention tm) { potentialInstantiationOf(_, _, tm) }
default predicate relevantTypeMention(Constraint tm) { potentialInstantiationOf(_, _, tm) }

Check warning

Code scanning / CodeQL

Missing QLDoc for parameter Warning

The QLDoc has no documentation for tm, but the QLDoc mentions constraint
@hvitved hvitved force-pushed the rust/type-inference-method-call-resolution-rework branch 8 times, most recently from 61866bf to 2d1ed65 Compare September 1, 2025 09:45
@hvitved hvitved force-pushed the rust/type-inference-method-call-resolution-rework branch from 2d1ed65 to 3d19a06 Compare September 1, 2025 10:30
@hvitved hvitved force-pushed the rust/type-inference-method-call-resolution-rework branch from 3d19a06 to 153c10b Compare September 1, 2025 17:56
@hvitved hvitved force-pushed the rust/type-inference-method-call-resolution-rework branch from 153c10b to e161d4c Compare September 1, 2025 18:35
@hvitved hvitved force-pushed the rust/type-inference-method-call-resolution-rework branch from dd45f7b to a20c440 Compare September 2, 2025 07:24
@hvitved hvitved force-pushed the rust/type-inference-method-call-resolution-rework branch 5 times, most recently from f45d2d5 to f9f8782 Compare September 3, 2025 13:07
pragma[nomagic]
private Type inferMethodCallExprType(AstNode n, TypePath path) {
exists(
MethodCallMatchingInput::Access a, MethodCallMatchingInput::AccessPosition apos, string state,

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-method-call-resolution-rework branch 2 times, most recently from 33482c4 to 9fbda33 Compare September 8, 2025 12:10
@hvitved hvitved force-pushed the rust/type-inference-method-call-resolution-rework branch 2 times, most recently from a9394b2 to e4d1bfd Compare September 8, 2025 19:41
@hvitved hvitved force-pushed the rust/type-inference-method-call-resolution-rework branch 4 times, most recently from 4dfa4cb to 9c8c066 Compare September 9, 2025 11:23
@hvitved hvitved force-pushed the rust/type-inference-method-call-resolution-rework branch 2 times, most recently from 9f5e7e2 to 9145b99 Compare September 9, 2025 14:22
}

/** Holds if this relevant access should satisfy `constraint`. */
Type getConstraint() { relevantAccessConstraint(a, e, target, apos, path, result) }
Type getConstraint(Declaration target) {

Check warning

Code scanning / CodeQL

Missing QLDoc for parameter Warning

The QLDoc has no documentation for target, but the QLDoc mentions constraint
@hvitved hvitved force-pushed the rust/type-inference-method-call-resolution-rework branch from 4d3e3ab to 47463e3 Compare September 10, 2025 11:17
* `self5` | `impl T2 for X` | `X`
*/
private class FunctionType extends TFunctionType {
private predicate asFunctionType(Function f, FunctionTypePosition pos, ImplOrTraitItemNode i) {

Check warning

Code scanning / CodeQL

Predicates starting with "get" or "as" should return a value Warning

This predicate starts with 'as' but does not return a value.
this = MkFunctionType(f, pos, i)
}

private predicate asInheritedFunctionType(

Check warning

Code scanning / CodeQL

Predicates starting with "get" or "as" should return a value Warning

This predicate starts with 'as' but does not return a value.
@hvitved hvitved force-pushed the rust/type-inference-method-call-resolution-rework branch from e56bc06 to 8da8b10 Compare September 10, 2025 13:35

pragma[nomagic]
private Function getACandidateTraitMethod() {
exists(TraitItemNode trait, ImplOrTraitItemNode i, FunctionType self, Function resolved |

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
.

pragma[nomagic]
private Function getACandidateTraitMethod() {
exists(TraitItemNode trait, ImplOrTraitItemNode i, FunctionType self, Function resolved |

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-method-call-resolution-rework branch from 8da8b10 to 4f84362 Compare September 10, 2025 15:06
Comment on lines +1196 to +1213
not impl.hasTrait()
or
methodCallVisibleImplTraitCandidate(mc, i)

Check warning

Code scanning / CodeQL

Var only used in one side of disjunct. Warning

The
variable impl
is only used in one side of disjunct.
@hvitved hvitved force-pushed the rust/type-inference-method-call-resolution-rework branch from 832546f to c7d4fc3 Compare September 12, 2025 09:11
* at `mc`.
*/
pragma[inline]
private predicate methodCallCandidate(

Check warning

Code scanning / CodeQL

Missing QLDoc for parameter Warning

The QLDoc has no documentation for rootTypePath, but the QLDoc mentions selfRootPath, and selfRootType, and selfType
predicate potentialInstantiationOf(
MethodCallCand mcc, TypeAbstraction abs, FunctionType constraint
) {
exists(MethodCall mc, string name, int arity, TypePath rootTypePath, Type rootType |

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
.
predicate potentialInstantiationOf(
MethodCallCand mcc, TypeAbstraction abs, FunctionType constraint
) {
exists(MethodCall mc, string name, int arity, TypePath rootTypePath, Type rootType |

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
.
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