Auto merge of #37460 - nrc:save-imports, r=eddyb

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
This commit is contained in:
bors 2016-10-30 17:01:28 -07:00 committed by GitHub
commit bfc9b29acc

View File

@ -129,7 +129,7 @@ fn from(id: DefId) -> Id {
#[derive(Debug, RustcEncodable)]
struct Import {
kind: ImportKind,
id: Id,
ref_id: Option<Id>,
span: SpanData,
name: String,
value: String,
@ -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(),
@ -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(),
@ -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(", "),