Skip to content

Commit bfc9b29

Browse files
authored
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
2 parents ea20ab1 + c751c08 commit bfc9b29

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc_save_analysis/json_dumper.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ impl From<DefId> for Id {
129129
#[derive(Debug, RustcEncodable)]
130130
struct Import {
131131
kind: ImportKind,
132-
id: Id,
132+
ref_id: Option<Id>,
133133
span: SpanData,
134134
name: String,
135135
value: String,
@@ -146,7 +146,7 @@ impl From<ExternCrateData> for Import {
146146
fn from(data: ExternCrateData) -> Import {
147147
Import {
148148
kind: ImportKind::ExternCrate,
149-
id: From::from(data.id),
149+
ref_id: None,
150150
span: data.span,
151151
name: data.name,
152152
value: String::new(),
@@ -157,7 +157,7 @@ impl From<UseData> for Import {
157157
fn from(data: UseData) -> Import {
158158
Import {
159159
kind: ImportKind::Use,
160-
id: From::from(data.id),
160+
ref_id: data.mod_id.map(|id| From::from(id)),
161161
span: data.span,
162162
name: data.name,
163163
value: String::new(),
@@ -168,7 +168,7 @@ impl From<UseGlobData> for Import {
168168
fn from(data: UseGlobData) -> Import {
169169
Import {
170170
kind: ImportKind::GlobUse,
171-
id: From::from(data.id),
171+
ref_id: None,
172172
span: data.span,
173173
name: "*".to_owned(),
174174
value: data.names.join(", "),

0 commit comments

Comments
 (0)