The way the code-map is currently set up, all source files of a crate and its dependencies are layout into one big "address space", e.g:
a.rs b.rs c.rs
|----------|--------------|--------------|
0 100 220 340 bytes
That means that adding a byte to a.rs will change all addresses in b.rs and c.rs. Consequently, were we to incorporate the verbatim BytePos values in the Spans contained in the AST, small changes would cause recompilations of seemingly unrelated files.
Thus, we need to find a more stable way of hashing spans, like expanding them to file-name:line:col (or not hash them at all, if we don't compile with debuginfo).
cc @nikomatsakis
The way the code-map is currently set up, all source files of a crate and its dependencies are layout into one big "address space", e.g:
That means that adding a byte to
a.rswill change all addresses inb.rsandc.rs. Consequently, were we to incorporate the verbatimBytePosvalues in theSpanscontained in the AST, small changes would cause recompilations of seemingly unrelated files.Thus, we need to find a more stable way of hashing spans, like expanding them to
file-name:line:col(or not hash them at all, if we don't compile with debuginfo).cc @nikomatsakis