-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Rust: Resolve Self
path in trait type of implementation
#19227
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
Conversation
There was a problem hiding this 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 adds a test case to verify that the Self path in the trait type of an implementation is correctly resolved. The changes introduce a new module (m23) with a trait (Trait1) and its implementation for a struct S using Self, and then exercise the implementation via a function call.
Files not reviewed (2)
- rust/ql/lib/codeql/rust/internal/PathResolution.qll: Language not supported
- rust/ql/test/library-tests/path-resolution/path-resolution.expected: Language not supported
Comments suppressed due to low confidence (1)
rust/ql/test/library-tests/path-resolution/main.rs:539
- [nitpick] Consider adding an assertion to verify that the resolution of 'Self' has been correctly applied rather than solely relying on printed output, to improve the test coverage.
println!("m23::<S as Trait1<S>>::f");
Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one trivial request. Also, remember DCA.
trait Trait1< | ||
T // I1 | ||
> { | ||
fn f(&self); // // I3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove extra //
.
Absolutely nothing happened in the DCA. |
We currently don't resolve the
Self
in: