pub fn read_source(
path: &Path,
overlay: &HashMap<PathBuf, String>,
) -> Result<String>Expand description
Read a source file from the overlay (keyed by canonicalised absolute
path; falls back to the literal path so a not-yet-created overlay entry
still matches). Every caller into this module now supplies a complete
overlay — content-ownership track (#1086) slice 5 removed the disk-read
fallback this used to have on a miss, so an incomplete overlay is a real
NotFound error here, not a silent disk read.
Finding #55/#65: tries the literal path first, canonicalize() only on a
miss — an in-memory/wasm project’s synthetic overlay keys never exist on
disk, so canonicalize() was a guaranteed-failing syscall on every read of
every such file, for no benefit (the literal-path lookup below already
finds the same entry).