From c751c08cf4c2a73b1a337fb74c4ccf0ee867bfac Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Sat, 29 Oct 2016 08:24:37 +1000 Subject: [PATCH] save-analysis: change imports to carry a ref id rather than their own node id --- src/librustc_save_analysis/json_dumper.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/librustc_save_analysis/json_dumper.rs b/src/librustc_save_analysis/json_dumper.rs index 0378d75cc6eb1..eb613c3afdab3 100644 --- a/src/librustc_save_analysis/json_dumper.rs +++ b/src/librustc_save_analysis/json_dumper.rs @@ -129,7 +129,7 @@ impl From for Id { #[derive(Debug, RustcEncodable)] struct Import { kind: ImportKind, - id: Id, + ref_id: Option, span: SpanData, name: String, value: String, @@ -146,7 +146,7 @@ impl From for Import { fn from(data: ExternCrateData) -> Import { Import { kind: ImportKind::ExternCrate, - id: From::from(data.id), + ref_id: None, span: data.span, name: data.name, value: String::new(), @@ -157,7 +157,7 @@ impl From for Import { fn from(data: UseData) -> Import { Import { kind: ImportKind::Use, - id: From::from(data.id), + ref_id: data.mod_id.map(|id| From::from(id)), span: data.span, name: data.name, value: String::new(), @@ -168,7 +168,7 @@ impl From for Import { fn from(data: UseGlobData) -> Import { Import { kind: ImportKind::GlobUse, - id: From::from(data.id), + ref_id: None, span: data.span, name: "*".to_owned(), value: data.names.join(", "),