Skip to content

Commit

Permalink
Auto merge of #37460 - nrc:save-imports, r=eddyb
Browse files Browse the repository at this point in the history
save-analysis: change imports to carry a ref id rather than their own…

… node id

To make jump to def for imports work

r? @eddyb
  • Loading branch information
bors committed Oct 31, 2016
2 parents ea20ab1 + c751c08 commit bfc9b29
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustc_save_analysis/json_dumper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl From<DefId> for Id {
#[derive(Debug, RustcEncodable)]
struct Import {
kind: ImportKind,
id: Id,
ref_id: Option<Id>,
span: SpanData,
name: String,
value: String,
Expand All @@ -146,7 +146,7 @@ impl From<ExternCrateData> 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(),
Expand All @@ -157,7 +157,7 @@ impl From<UseData> 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(),
Expand All @@ -168,7 +168,7 @@ impl From<UseGlobData> 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(", "),
Expand Down

0 comments on commit bfc9b29

Please sign in to comment.