-
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 call From looking at the AST it seems I could get the |
Beta Was this translation helpful? Give feedback.
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 |
Beta Was this translation helpful? Give feedback.
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: