mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Rust: add Locatable::fromSource
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import rust
|
||||
|
||||
from Function f
|
||||
where exists(f.getLocation().getFile().getRelativePath())
|
||||
where f.fromSource()
|
||||
select f
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import rust
|
||||
|
||||
from Function f
|
||||
where exists(f.getLocation().getFile().getRelativePath())
|
||||
where f.fromSource()
|
||||
select f
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import rust
|
||||
|
||||
from Function f
|
||||
where exists(f.getLocation().getFile().getRelativePath())
|
||||
where f.fromSource()
|
||||
select f
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import rust
|
||||
|
||||
from Function f
|
||||
where exists(f.getLocation().getFile().getRelativePath())
|
||||
where f.fromSource()
|
||||
select f
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import rust
|
||||
|
||||
from Function f
|
||||
where exists(f.getLocation().getFile().getRelativePath())
|
||||
where f.fromSource()
|
||||
select f
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import rust
|
||||
|
||||
from Function f
|
||||
where exists(f.getLocation().getFile().getRelativePath())
|
||||
where f.fromSource()
|
||||
select f
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import rust
|
||||
|
||||
from Function f
|
||||
where exists(f.getLocation().getFile().getRelativePath())
|
||||
where f.fromSource()
|
||||
select f
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import rust
|
||||
|
||||
from Function f
|
||||
where exists(f.getLocation().getFile().getRelativePath())
|
||||
where f.fromSource()
|
||||
select f
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import rust
|
||||
|
||||
from Function f
|
||||
where exists(f.getLocation().getFile().getRelativePath())
|
||||
where f.fromSource()
|
||||
select f
|
||||
|
||||
@@ -41,6 +41,9 @@ module Impl {
|
||||
* Gets the primary file where this element occurs.
|
||||
*/
|
||||
File getFile() { result = this.getLocation().getFile() }
|
||||
|
||||
/** Holds if this element is from source code. */
|
||||
predicate fromSource() { exists(this.getFile().getRelativePath()) }
|
||||
}
|
||||
|
||||
/** Gets the non-synthesized location of `l`, if any. */
|
||||
|
||||
Reference in New Issue
Block a user