Skip to content

Rust: Move local name resolution logic into shared library#21873

Draft
hvitved wants to merge 5 commits into
github:mainfrom
hvitved:local-name-resolution
Draft

Rust: Move local name resolution logic into shared library#21873
hvitved wants to merge 5 commits into
github:mainfrom
hvitved:local-name-resolution

Conversation

@hvitved
Copy link
Copy Markdown
Contributor

@hvitved hvitved commented May 20, 2026

No description provided.

@github-actions github-actions Bot added the Rust Pull requests that update Rust code label May 20, 2026
Comment thread rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll Fixed
Comment thread rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll Fixed
Comment thread rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll Fixed
Comment thread rust/ql/lib/codeql/rust/elements/internal/LocalNameBinding.qll Fixed
Comment thread shared/namebinding/codeql/namebinding/LocalNameBinding.qll Fixed
Comment thread rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll Fixed
Comment thread rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll Fixed
Comment thread rust/ql/lib/codeql/rust/elements/internal/LocalNameBinding.qll Fixed
Comment thread rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll Fixed
class NestedFunctionAccess extends LocalAccess {
private Function f;

NestedFunctionAccess() { nestedFunctionAccess(_, f, this) }
@hvitved hvitved force-pushed the local-name-resolution branch from 46e6643 to 78a5319 Compare May 21, 2026 12:58
Comment thread shared/namebinding/codeql/namebinding/LocalNameBinding.qll Fixed
Comment thread shared/namebinding/codeql/namebinding/LocalNameBinding.qll Fixed

/** Gets the name of this variable as a string. */
string getText() { result = text }
predicate accessCand(AstNode n, string name) {
/**
* Holds if `n` is a node that may access a local named `name`.
*/
predicate accessCand(AstNode n, string name);
Comment thread shared/namebinding/codeql/namebinding/LocalNameBinding.qll Fixed
@hvitved hvitved force-pushed the local-name-resolution branch from 0de851d to 35ff093 Compare May 21, 2026 14:46
Comment thread shared/namebinding/codeql/namebinding/LocalNameBinding.qll Fixed
@hvitved hvitved force-pushed the local-name-resolution branch from 35ff093 to cad848a Compare May 21, 2026 14:49
* We also move any `else` branch _before_ the condition to ensure that shadowing declarations
* inside the condition are not in scope.
*/
private AstNode getChildAdj(AstNode parent, int index) {
@hvitved hvitved force-pushed the local-name-resolution branch from cad848a to 4db27cf Compare May 21, 2026 19:50
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.

2 participants