about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2021-05-12 00:10:41 -0400
committerAaron Hill <aa1ronham@gmail.com>2021-05-12 15:44:46 -0400
commitcdca3c81c1eed6f09733beea4dc2517e6f3d71f6 (patch)
treec8a68979f6ca03b1fe6945e86e4d778c8a2c90c0 /compiler/rustc_codegen_llvm/src
parent70e52caed91a43fc01867921e67fcd3478056edd (diff)
downloadrust-cdca3c81c1eed6f09733beea4dc2517e6f3d71f6.tar.gz
rust-cdca3c81c1eed6f09733beea4dc2517e6f3d71f6.zip
Preserve `SyntaxContext` for invalid/dummy spans in crate metadata
Fixes #85197

We already preserved the `SyntaxContext` for invalid/dummy spans in the
incremental cache, but we weren't doing the same for crate metadata.
If an invalid (lo/hi from different files) span is written to the
incremental cache, we will decode it with a 'dummy' location, but keep
the original `SyntaxContext`. Since the crate metadata encoder was only
checking for `DUMMY_SP` (dummy location + root `SyntaxContext`),
the metadata encoder would treat it as a normal span, encoding the
`SyntaxContext`. As a result, the final span encoded to the metadata
would change across sessions, even if the crate itself was unchanged.

This PR updates our encoding of spans in the crate metadata to mirror
the encoding of spans into the incremental cache. We now always encode a
`SyntaxContext`, and encode location information for spans with a
non-dummy location.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions