Skip to content

Rust: Avoid path resolution in Element.toString - #22520

Draft
hvitved wants to merge 1 commit into
mainfrom
hvitved-rust-tostring-implementations
Draft

Rust: Avoid path resolution in Element.toString#22520
hvitved wants to merge 1 commit into
mainfrom
hvitved-rust-tostring-implementations

Conversation

@hvitved

@hvitved hvitved commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Make Element.toString() independent of path resolution by replacing its getAPrimaryQlClass() fallback with "???" and defining equivalent primary-class toStringImpl() implementations on the concrete element classes that need them.

Add an AST consistency predicate that identifies elements whose string representation is missing or still uses the fallback.

Testing

  • codeql query compile rust/ql/consistency-queries/AstConsistency.ql

@github-actions github-actions Bot added the Rust Pull requests that update Rust code label Sep 7, 2026
@hvitved
hvitved force-pushed the hvitved-rust-tostring-implementations branch from e9b934f to f6c238f Compare September 7, 2026 13:37
Define string representations on concrete element classes, make existing renderers total when unresolved child data is absent, and remove the path-resolution-dependent fallback from Element.

Add a consistency check for elements that lack a string representation and update generated-file metadata for customized wrappers.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@hvitved
hvitved force-pushed the hvitved-rust-tostring-implementations branch from f6c238f to 90e99fa Compare September 7, 2026 17:29
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