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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//! **`include-not-found`**: an `#include` whose file is not there.
//!
//! ```cpp
//! #include <vectr> // no such header
//! #include "helpr.h" // no such file next to this one
//! ```
//!
//! The first thing that goes wrong in a translation unit, and the one a user can act on without knowing anything
//! about C++: the file is not where the directive says it is.
//!
//! # Why this is a check and not part of the reading
//!
//! The reading already knows. [`IncludeFact::resolved`](crate::IncludeFact::resolved) is `None` for a header the
//! resolver did not find, and its documentation says so in as many words — *"a header that did not resolve keeps
//! its spelling, because 'this project includes something we cannot find' is a fact a consumer wants to see rather
//! than a gap to hide"*. What was missing is a channel that shows it. **An index is not a complaint.**
//!
//! # The one form that is not reported, and why it is the whole of the care here
//!
//! [`IncludeForm::Macro`] — `#include BOOST_VERSION_HEADER` — is **not** checked, and that is not a gap. The
//! directive names a macro, so its target is not known until the macro is expanded, and a resolver that has not
//! expanded it has learned nothing. Reporting it would be reporting the *shape* of the directive ("this is not a
//! literal path") as if it were a fact about the file system. `Unknown` is the honest answer there, and this layer
//! reports nothing on `Unknown`.
//!
//! The other two forms are literals. The resolver looked for `vectr` on the system path and for `helpr.h` next to
//! the file, and did not find it. That is `Known::No`.
//!
//! # And the branches nobody compiles
//!
//! **An `#include` in a branch this configuration does not take is not a missing file.** neovim writes
//!
//! ```c
//! #if defined(__linux__)
//! # include <execinfo.h>
//! #endif
//! ```
//!
//! and a Windows build never opens that header, so a resolver that looked and failed has answered a question about
//! a line that is not in the program. The file's summary stores its guards as **questions, never answers** (a
//! compilation decides them, and a summary is keyed without one), so the answer is asked where it lives —
//! [`ProjectIndex::the_guard_is_taken`] — and only a **decided** `Inactive` silences the finding: a guard this
//! layer cannot decide keeps it, because "I could not tell" must not become "nothing to see". Measured on the
//! neovim census: the four remaining include misses are glibc and sanitizer headers, and the platform-only ones
//! behind `#if defined(__linux__)` are silent.
//!
//! # Severity
//!
//! A **warning**, and the reason is whose claim it is: the search is this analysis's, built from the compile
//! database, the toolchain discovery and the project's own include graph. A build can pass `-I` paths through a
//! generator, or have an SDK where discovery cannot see it — so "I did not find it" is a warning about our search
//! rather than an error about the program. See [`DiagnosticCode::severity`].
use crateIncludeForm;
use ;
/// **`include-not-found`** — see the module documentation.
;