Skip to content

Rust: Remove unused impl type #19555

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

Merged
merged 1 commit into from
May 22, 2025
Merged

Rust: Remove unused impl type #19555

merged 1 commit into from
May 22, 2025

Conversation

paldepind
Copy link
Contributor

@paldepind paldepind commented May 22, 2025

I just realized that the type for impl blocks is in fact unused after the recent changes to method resolution.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label May 22, 2025
@paldepind paldepind marked this pull request as ready for review May 22, 2025 08:33
@Copilot Copilot AI review requested due to automatic review settings May 22, 2025 08:33
@paldepind paldepind requested a review from a team as a code owner May 22, 2025 08:33
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes now-unused support for treating impl blocks as types following recent method resolution changes.

  • Deleted the isImplSelfTypeParam predicate and the ImplMention class in TypeMention.qll.
  • Removed the TImpl variant and the ImplType class in Type.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

Copy link
Contributor

@geoffw0 geoffw0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume we don't expect to need this type again in future.

@paldepind
Copy link
Contributor Author

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).

@paldepind paldepind merged commit c4bbfbc into github:main May 22, 2025
16 checks passed
@paldepind paldepind deleted the rust/timpl branch May 22, 2025 11:54
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy