Skip to content
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: Generate ParamBase, a superclass of Param and SelfParam #18092

Merged
merged 2 commits into from
Nov 25, 2024

Conversation

paldepind
Copy link
Contributor

For now I've used it a few places in DataFlowImpl.qll, but it should also be very useful for #18088.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Nov 25, 2024
// A Param. For example:
todo!()
// A parameter in a function or method. For example `x` in:
fn new(x: T) -> Foo<T> {

Check notice

Code scanning / CodeQL

Unused variable Note generated test

Variable 'x' is not used.
// A SelfParam. For example:
todo!()
// A `self` parameter. For example `self` in:
fn push(&mut self, value: T) {

Check notice

Code scanning / CodeQL

Unused variable Note generated test

Variable 'value' is not used.
@@ -284,7 +273,7 @@
private module SsaFlow = SsaImpl::DataFlowIntegration;

private Node::ParameterNode toParameterNode(ParamCfgNode p) {
result.(Node::PositionalParameterNode).getParameter() = p
result.(Node::ParameterNode).getParameter() = p

Check warning

Code scanning / CodeQL

Redundant cast Warning

Redundant cast to
ParameterNode
.
@@ -98,6 +98,7 @@
import codeql.rust.elements.OffsetOfExpr
import codeql.rust.elements.OrPat
import codeql.rust.elements.Param
import codeql.rust.elements.ParamBase

Check warning

Code scanning / CodeQL

Redundant import Warning

Redundant import, the module is already imported inside
codeql.rust.elements.Param
.
Redundant import, the module is already imported inside
codeql.rust.elements.SelfParam
.
*/

private import internal.ParamBaseImpl
import codeql.rust.elements.AstNode

Check warning

Code scanning / CodeQL

Redundant import Warning

Redundant import, the module is already imported inside
codeql.rust.elements.Attr
.
Redundant import, the module is already imported inside
codeql.rust.elements.TypeRef
.
@paldepind paldepind marked this pull request as ready for review November 25, 2024 13:37
Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

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

Great!

@paldepind paldepind merged commit d5c8dfd into github:main Nov 25, 2024
15 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.

2 participants