[Rust] Proc macro expansion support
Hello, is there any way or are you planning to implement analysis on expanded proc macros? Im currently trying codeQL on Anchor, which makes heavy use of proc macros.
When running a simple test, I see that by default, codeQL doesn't fully resolve references that exist in the expanded code, meaning i only get a reference to the macro that generated the referenced code, but I dont know which part of the macro is to blame (i used cargo expand) to test that. It seems though that placing the expanded file in the root dir does indeed make it be analyzed, but I dont know if this fully supported at the moment.
Is there a better way to do this?
Hi.
The Rust extractor should be expanding all macros, including procedural macros. Do you have a link to a run where this does not happen?
Perhaps I misunderstood; If you are asking whether we can show results inside expanded macros, using the expanded source code, then the answer is no. While we do have the AST of the expanded macros, we only have locations of the original source code for use in alerts.
Yep, should have been clearer sorry. I see, do you plan to implement that at any point?
I see, do you plan to implement that at any point?
No plans, sorry.