Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust: Implement basic type inference in QL #18632

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Jan 30, 2025

No description provided.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Jan 30, 2025
@hvitved hvitved force-pushed the rust/type-inference branch 4 times, most recently from 66bea42 to 2d0e953 Compare February 4, 2025 12:10
@hvitved hvitved force-pushed the rust/type-inference branch 7 times, most recently from c88c9fe to a8540b1 Compare February 7, 2025 14:58
@hvitved hvitved force-pushed the rust/type-inference branch 3 times, most recently from 02184af to 4f723dd Compare February 10, 2025 12:26
@hvitved hvitved force-pushed the rust/type-inference branch 6 times, most recently from 486f813 to a254679 Compare February 13, 2025 09:02
@@ -27,6 +27,13 @@
class RecordExpr extends Generated::RecordExpr {
override string toString() { result = this.getPath().toString() + " {...}" }

/** Gets the record expression for the field `field`. */
pragma[nomagic]
RecordExprField getFieldExpr(string name) {

Check warning

Code scanning / CodeQL

Missing QLDoc for parameter Warning

The QLDoc has no documentation for name, but the QLDoc mentions field
@hvitved hvitved force-pushed the rust/type-inference branch 3 times, most recently from 42e5970 to be2ec0f Compare February 18, 2025 14:36
@hvitved hvitved force-pushed the rust/type-inference branch from 5a1567c to 3f1a6c3 Compare February 26, 2025 13:58
//
// We get that the type path "0" resolves to `T1` for the `impl` block,
// which is considered a base type mention of `S`.
exists(PathMention selfPath, PathMention p, TypeParameter tp, int i |

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
.
Comment on lines +510 to +519
exists(int i |
result = path.getPart().getGenericArgList().getTypeArgument(i) and
tp = resolvePath(path).getTypeParam(i)
)
or
exists(ImplItemNode i, Function f, TypeParam mid |
result = getExplicitTypeArgMention(path.getQualifier(), mid) and
f = resolvePath(path) and
f = i.getAnAssocItem()
)

Check warning

Code scanning / CodeQL

Var only used in one side of disjunct. Warning

The
variable tp
is only used in one side of disjunct.
tp = resolvePath(path).getTypeParam(i)
)
or
exists(ImplItemNode i, Function f, TypeParam mid |

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 branch from 3f1a6c3 to 54ae28d Compare February 26, 2025 14:25
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