-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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: Exclude results inside macro expansions from unused entity queries #17865
Conversation
186ff94
to
072b836
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.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
072b836
to
2a68d6d
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.
Looks great!
One question, for my education.
We need to wait for the underlying PR to be merged, and probably do a DCA run.
* Gets the nearest enclosing parent of this node, which is also an `AstNode`, | ||
* if any. | ||
*/ | ||
AstNode getParentNode() { result = getParentOfAstStep*(getImmediateParent(this)) } |
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.
I'd prefer getParent
. I think all immediate parents are actually AstNodes, and if not, we should probably change the schema.
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.
I can't be named getParent
because it will then conflict with the auto-generated Comment.getParent
predicate :-(
bd2e98c
to
d0f9a0b
Compare
@@ -434,7 +438,7 @@ | |||
fn increment( | |||
&mut self, | |||
times: i32, | |||
unused: i32, // $ Alert[rust/unused-variable] | |||
unused: &mut i32, // $ Alert[rust/unused-variable] |
Check notice
Code scanning / CodeQL
Unused variable Note test
// --- macros --- | ||
|
||
fn macros() { | ||
let x; |
Check notice
Code scanning / CodeQL
Unused variable Note test
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.
No description provided.