Skip to content

Commit 43760a4

Browse files
committed
Encode proper spans in crate metadata.
The spans previously encoded only span the first token after the opening brace, up to the closing brace of inline `mod` declarations. Thus, when examining exports from an external crate, the spans don't include the header of inline `mod` declarations.
1 parent bcd75d6 commit 43760a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_metadata/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
563563
Entry {
564564
kind: EntryKind::Mod(self.lazy(&data)),
565565
visibility: self.lazy(&ty::Visibility::from_hir(vis, id, tcx)),
566-
span: self.lazy(&md.inner),
566+
span: self.lazy(&tcx.def_span(def_id)),
567567
attributes: self.encode_attributes(attrs),
568568
children: self.lazy_seq(md.item_ids.iter().map(|item_id| {
569569
tcx.hir.local_def_id(item_id.id).index

0 commit comments

Comments
 (0)