Rust: Remove unused impl type#19555
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR removes now-unused support for treating impl blocks as types following recent method resolution changes.
- Deleted the
isImplSelfTypeParampredicate and theImplMentionclass inTypeMention.qll. - Removed the
TImplvariant and theImplTypeclass inType.qll.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| rust/ql/lib/codeql/rust/internal/TypeMention.qll | Removed ImplMention class and related predicate |
| rust/ql/lib/codeql/rust/internal/Type.qll | Dropped TImpl from TType union and deleted ImplType |
Comments suppressed due to low confidence (2)
rust/ql/lib/codeql/rust/internal/TypeMention.qll:191
- Removal of the ImplMention class could affect type resolution for impl blocks. Please add or update tests to ensure no regressions in resolving self-path type parameters.
class ImplMention extends TypeMention, ImplItemNode {
rust/ql/lib/codeql/rust/internal/Type.qll:15
- The TImpl variant and ImplType class have been removed. Verify with tests that all type-resolution scenarios formerly handled by this variant are still correctly covered.
TImpl(Impl i) or
geoffw0
left a comment
There was a problem hiding this comment.
I assume we don't expect to need this type again in future.
Right now it doesn't look very likely. I think maybe if in some future the shared library handles method resolution something like it could be needed. But that's highly speculative and even if it does happen it could look completely different. First DCA filed for some reason but the looks fine (no changes). |
I just realized that the type for
implblocks is in fact unused after the recent changes to method resolution.