forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAddressableImpl.qll
More file actions
53 lines (48 loc) · 1.55 KB
/
AddressableImpl.qll
File metadata and controls
53 lines (48 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* This module provides a hand-modifiable wrapper around the generated class `Addressable`.
*
* INTERNAL: Do not use.
*/
private import codeql.rust.elements.internal.generated.Addressable
/**
* INTERNAL: This module contains the customizable definition of `Addressable` and should not
* be referenced directly.
*/
module Impl {
private import rust
private import codeql.rust.internal.PathResolution
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* Something that can be addressed by a path.
*
* TODO: This does not yet include all possible cases.
*/
class Addressable extends Generated::Addressable {
/**
* Gets the canonical path of this item, if any.
*
* The crate `c` is the root of the path.
*
* See [The Rust Reference][1] for more details.
*
* [1]: https://doc.rust-lang.org/reference/paths.html#canonical-paths
*/
string getCanonicalPath(Crate c) { result = this.(ItemNode).getCanonicalPath(c) }
/**
* Gets the canonical path of this item, if any.
*
* See [The Rust Reference][1] for more details.
*
* [1]: https://doc.rust-lang.org/reference/paths.html#canonical-paths
*/
string getCanonicalPath() { result = this.getCanonicalPath(_) }
/**
* Holds if this item has a canonical path.
*
* See [The Rust Reference][1] for more details.
*
* [1]: https://doc.rust-lang.org/reference/paths.html#canonical-paths
*/
predicate hasCanonicalPath() { exists(this.getCanonicalPath()) }
}
}