diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2020-03-17 11:45:02 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2020-03-22 23:40:19 -0400 |
| commit | 96e2d03d4b527b3870bb8cc4fd6dd41e57be109d (patch) | |
| tree | 5e70fd04b90bd64d2ab034008a0b4290f82d50cc /src/librustc_resolve | |
| parent | e4b01c7791446b2f79a1b1d517223378df2bf5f2 (diff) | |
| download | rust-96e2d03d4b527b3870bb8cc4fd6dd41e57be109d.tar.gz rust-96e2d03d4b527b3870bb8cc4fd6dd41e57be109d.zip | |
Store idents for `DefPathData` into crate metadata
Previously, we threw away the `Span` associated with a definition's identifier when we encoded crate metadata, causing us to lose location and hygiene information. We now store the identifier's `Span` in the crate metadata. When we decode items from the metadata, we combine the name and span back into an `Ident`. This improves the output of several tests, which previously had messages suppressed due to dummy spans. This is a prerequisite for #68686, since throwing away a `Span` means that we lose hygiene information.
Diffstat (limited to 'src/librustc_resolve')
| -rw-r--r-- | src/librustc_resolve/build_reduced_graph.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index 77d6e4560ab..d29ec83bfa0 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -904,7 +904,10 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> { self.insert_field_names(def_id, field_names); } Res::Def(DefKind::AssocFn, def_id) => { - if cstore.associated_item_cloned_untracked(def_id).method_has_self_argument { + if cstore + .associated_item_cloned_untracked(def_id, self.r.session) + .method_has_self_argument + { self.r.has_self.insert(def_id); } } |
