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
//! The `file:line` opt-in, shared by both symbol backends (#803).
//!
//! This lives outside `object_symbols` and `pdb_symbols` because those two are
//! mutually exclusive by target: `object_symbols` is compiled off Windows and
//! `pdb_symbols` on it. The opt-in belongs to neither, and a constant that only
//! one platform can see is a constant the other platform will re-spell — which
//! is exactly the drift the repo's env-literal lint exists to prevent. One
//! spelling, visible to both, means a rename cannot leave half the workers
//! reading a name nobody sets.
/// Opt-in for `file:line` resolution.
///
/// Off by default because it is not free: names come from a symbol-table walk,
/// while line numbers parse a line program for every module in the capture. A
/// caller that only wants "which function" should not pay for it.
pub const LINE_NUMBERS_ENV: &str = "KERNAL_API_SYMBOL_LINE_NUMBERS";
/// Whether the caller asked for line numbers.
/// The decision, separated from reading the environment.
///
/// Split so it can be tested without `set_var`. Env-mutating tests race under
/// a parallel runner — one test's variable leaks into another's read — and
/// this repo has already been bitten by exactly that. A pure function takes
/// the value as an argument and cannot.