about summary refs log tree commit diff
path: root/compiler/rustc_metadata
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2020-09-18 21:49:11 -0400
committerAaron Hill <aa1ronham@gmail.com>2020-09-21 15:10:16 -0400
commite734733a9e931cbbe26cfccbdf9849faef8e5125 (patch)
treebefb546ce63c508298387ba0eca6c2efd8da9c74 /compiler/rustc_metadata
parent4eff9b0b29a8898c839d46f3c66526710afed68a (diff)
downloadrust-e734733a9e931cbbe26cfccbdf9849faef8e5125.tar.gz
rust-e734733a9e931cbbe26cfccbdf9849faef8e5125.zip
Record `tcx.def_span` instead of `item.span` in crate metadata
This was missed in PR #75465. As a result, a few places have been using
the full body span of functions, instead of just the header span.
Diffstat (limited to 'compiler/rustc_metadata')
-rw-r--r--compiler/rustc_metadata/src/rmeta/encoder.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs
index eb091d86b82..d5b0a868a36 100644
--- a/compiler/rustc_metadata/src/rmeta/encoder.rs
+++ b/compiler/rustc_metadata/src/rmeta/encoder.rs
@@ -1300,7 +1300,7 @@ impl EncodeContext<'a, 'tcx> {
         });
         record!(self.tables.visibility[def_id] <-
             ty::Visibility::from_hir(&item.vis, item.hir_id, tcx));
-        record!(self.tables.span[def_id] <- item.span);
+        record!(self.tables.span[def_id] <- self.tcx.def_span(def_id));
         record!(self.tables.attributes[def_id] <- item.attrs);
         // FIXME(eddyb) there should be a nicer way to do this.
         match item.kind {