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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! One physical declaration site, and the definition it declares.
use StructureKind;
use IrRange;
/// The position of one definition in `FileIr::definition_sites`.
///
/// Opaque, because it is an identity rather than a number: it is minted where
/// the definition is recognized, and a caller that could build one from a count
/// could name a definition the visitor never recorded.
///
/// This is the join key a graph node follows to reach the physical declaration
/// that states it. A name is not a join key — two functions can share one — and
/// neither is a span, because a declaration and the attribute above it can
/// share theirs. The ordinal is the one identity the visitor already
/// established.
;
/// The position of one physical declaration in `FileIr::structure_sites`.
///
/// Opaque for the reason [`DefinitionSiteId`] is, and a distinct type from it
/// for one more: the two tables are filled by one call, in one order, and both
/// ordinals are `usize`. A caller holding the pair as bare numbers can pass them
/// the other way round and every arithmetic on them still typechecks.
;
/// One physical declaration, covering everything its source writes for it.
///
/// A definition site names where a declared *name* sits, because that is what a
/// resolution report points at. A structure site covers the whole declaration —
/// attributes, signature, and body — because that is what an outline shows and
/// what a reader asks to read.
///
/// Both are recorded by one traversal, so a source is walked once for the pair
/// and the ordinal linking them is the visitor's own rather than a later
/// re-derivation.