[Rust] How do I query function and module attributes?
Open
question
Rust
- Dominant language
- CodeQL
- Stars
- 10.1k
- Forks
- 2.1k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 141
Description
I wanted to filter out tests from my results, based on if they either had a #[test] attribute or #[cfg(test)].
Currently tried something similar to this but cant figure out how to properly filter this from the docs
```ql
predicate doesntWork(Module mod, Attr a, Meta m) {
a = mod.getAnAttr() and
m = a.getMeta() and
m.hasPath() and
m.getPath().toString() = "cfg" and
m.hasTokenTree()
}
```
Contributor guide
Assessment
This issue has not been assessed yet.