|
I just saw the developer preview for Rust and wanted to try it out. I'm trying to find all calls to pub fn name_length(name: String) -> usize {
name.len()
}I expected it to work like this but there is no method for accessing the type information. import rust
from MethodCallExpr call
where
call.getIdentifier().toString() = "len" and
call.getReceiver().getType().toString() = "String"
select callFrom looking at the AST it seems I could get the |
Answered by
hvitved
Jul 10, 2025
Replies: 1 comment
|
Type information is currently not exposed in the public API, since we still haven't decided what that API should look like. In the meantime, you can use the following: from MethodCallExpr call
where
call.getStaticTarget().getCanonicalPath() = "<core::str>::len"
select call |
0 replies
Answer selected by
Fee0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Type information is currently not exposed in the public API, since we still haven't decided what that API should look like.
In the meantime, you can use the following: