Rust: Improve toString for impl#20393
Merged
paldepind merged 1 commit intogithub:mainfrom Sep 9, 2025
Merged
Conversation
a01af3d to
765685c
Compare
toString implementationstoString for impl
765685c to
f7c7466
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR improves the toString representation for impl trait types and related AST nodes in the Rust CodeQL library. The changes make the string representation more readable by replacing generic names like "ImplTraitTypeRepr" with user-friendly formats like "impl ...".
- Adds custom
toStringimplementations for several type-related classes - Updates type bound and type bound list string representations
- Modifies lifetime string representation to use abbreviated format
Reviewed Changes
Copilot reviewed 7 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| rust/ql/test/library-tests/type-inference/type-inference.expected | Test expectations updated to reflect new string representations |
| rust/ql/lib/codeql/rust/elements/internal/ImplTraitTypeReprImpl.qll | Adds toString implementation for impl trait types using "impl ..." format |
| rust/ql/lib/codeql/rust/elements/internal/TypeBoundListImpl.qll | Implements string representation for type bound lists with " + " separator |
| rust/ql/lib/codeql/rust/elements/internal/TypeBoundImpl.qll | Adds abbreviated string representation for type bounds |
| rust/ql/lib/codeql/rust/elements/internal/LifetimeImpl.qll | Updates lifetime string representation to use abbreviated format |
| rust/ql/.gitattributes | Removes linguist-generated markers for customized implementation files |
| rust/ql/.generated.list | Removes entries for files that are no longer auto-generated |
hvitved
approved these changes
Sep 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve
toStringforimpland a few nodes related to it.