Including `.inc` files baffles rust-analyzer
When rust-analyzer sees us do include!(FILENAME)
, where FILENAME doesn't end with .rs, it complains with "failed to load file."
This appears to be an instance of https://github.com/rust-analyzer/rust-analyzer/issues/10178
We use include!
in two places:
-
tor-proto/src/crypto/cell.rs
, where we include a testdata file full of encrypted cells. -
tor-dirmgr/src/config.rs
, where we include a set of fallback directories.
Our options seem to be:
- wait for the rust-analyzer bug to get fixed
- Tolerate spurious errors from rust-analyzer
- Rename these files to end with
.rs
, even though they aren't valid rust modules. - Find some other clever workaround
Options I wouldn't like:
- Including these files verbatim in the main source code files. (The test vectors are ugly, and the fallback directories are machine-generated.)