Auto merge of #76658 - Aaron1011:fix/encode-dummy-loc-span, r=lcnr
Properly encode spans with a dummy location and non-root `SyntaxContext` Previously, we would throw away the `SyntaxContext` of any span with a dummy location during metadata encoding. This commit makes metadata Span encoding consistent with incr-cache Span encoding - an 'invalid span' tag is only used when it doesn't lose any information.
This commit is contained in:
commit
b6c84553c4
11 changed files with 160 additions and 158 deletions
|
@ -162,7 +162,7 @@ impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for ExpnId {
|
|||
|
||||
impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for Span {
|
||||
fn encode(&self, s: &mut EncodeContext<'a, 'tcx>) -> opaque::EncodeResult {
|
||||
if self.is_dummy() {
|
||||
if *self == rustc_span::DUMMY_SP {
|
||||
return TAG_INVALID_SPAN.encode(s);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue