-
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: Generate ParamBase
, a superclass of Param
and SelfParam
#18092
Conversation
// 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
// 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
@@ -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
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
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
codeql.rust.elements.Attr
Redundant import, the module is already imported inside
codeql.rust.elements.TypeRef
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.
Great!
For now I've used it a few places in
DataFlowImpl.qll
, but it should also be very useful for #18088.