Skip to content

Incremental compilation: Be smart about hashing spans #33888

Closed
@michaelwoerister

Description

@michaelwoerister

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions