Skip to content

Conversation

@hvitved
Copy link
Contributor

@hvitved hvitved commented Oct 29, 2024

No description provided.

Copy link

@github-advanced-security github-advanced-security bot left a 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.

@hvitved hvitved force-pushed the rust/unused-macro-expansion branch from 072b836 to 2a68d6d Compare October 29, 2024 13:49
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.

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)) }
Copy link
Contributor

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.

Copy link
Contributor Author

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 :-(

&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

Variable 'unused' is not used.
// --- macros ---

fn macros() {
let x;

Check notice

Code scanning / CodeQL

Unused variable Note test

Variable 'x' is not used.
@hvitved hvitved marked this pull request as ready for review October 31, 2024 10:55
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.

LGTM.

@hvitved hvitved merged commit 662a824 into github:main Nov 3, 2024
11 checks passed
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.

3 participants