-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Rust: Take where
clauses into account in path resolution
#19193
base: main
Are you sure you want to change the base?
Conversation
6fc9369
to
9117247
Compare
9117247
to
f17ffe3
Compare
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 fixes a stray whitespace issue in a comment marker in the type inference tests and adds a new test module to verify that Rust’s path resolution correctly takes into account where clauses.
- Fixed whitespace in a comment marker in the type inference test case
- Added a new module (m24) in path resolution tests to exercise trait bounds in where clauses
Reviewed Changes
Copilot reviewed 2 out of 6 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
rust/ql/test/library-tests/type-inference/main.rs | Trimmed stray whitespace in the comment marker for a method call to ensure test annotations are correctly formatted. |
rust/ql/test/library-tests/path-resolution/main.rs | Introduced module m24 with trait definitions and implementations to test path resolution logic involving where clauses. |
Files not reviewed (4)
- rust/ql/lib/codeql/rust/internal/PathResolution.qll: Language not supported
- rust/ql/lib/utils/test/PathResolutionInlineExpectationsTest.qll: Language not supported
- rust/ql/test/library-tests/path-resolution/path-resolution.expected: Language not supported
- rust/ql/test/library-tests/variables/variables.ql: Language not supported
let impl_obj = Implementor; // $ item=I118 | ||
let generic = GenericStruct { data: impl_obj }; // $ item=I115 | ||
|
||
generic.call_trait_a(); // $ MISSING: item=I116 |
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.
The annotation '$ MISSING: item=I116' on this line is inconsistent with other markers in the file. If it is not intended, please remove or correct it to match the expected format.
generic.call_trait_a(); // $ MISSING: item=I116 | |
generic.call_trait_a(); // $ item=I116 |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
I used Copilot Agent to generate the test case, which mostly worked fine, except it inserted a stray whitespace in one of the comment markers, which took my quite a while to identify. To prevent this from happening again, I've inserted appropriate trimming of the markers.