Skip to content

Commit b3ed09d

Browse files
committed
Rust: fixes after rust-analyzer update
1 parent b7fe284 commit b3ed09d

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

rust/extractor/src/crate_graph.rs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,12 @@ pub fn extract_crate_graph(trap_provider: &trap::TrapFileProvider, db: &RootData
123123
let mut types = Vec::new();
124124
for (name, item) in items.entries() {
125125
let def = item.with_visibility(ra_ap_hir::Visibility::Public);
126-
if let Some((value, _, _import)) = def.values {
126+
if let Some(ra_ap_hir_def::per_ns::Item {
127+
def: value,
128+
vis: _,
129+
import: _,
130+
}) = def.values
131+
{
127132
match value {
128133
ModuleDefId::FunctionId(function) => {
129134
let type_ = db.value_ty(function.into());
@@ -178,10 +183,15 @@ pub fn extract_crate_graph(trap_provider: &trap::TrapFileProvider, db: &RootData
178183
_ => (),
179184
}
180185
}
181-
if let Some((type_id, _, _import)) = def.types {
186+
if let Some(ra_ap_hir_def::per_ns::Item {
187+
def: type_id,
188+
vis: _,
189+
import: _,
190+
}) = def.types
191+
{
182192
if let ModuleDefId::AdtId(adt_id) = type_id {
183193
match adt_id {
184-
ra_ap_hir::AdtId::StructId(struct_id) => {
194+
ra_ap_hir_def::AdtId::StructId(struct_id) => {
185195
let content =
186196
emit_variant_data(trap, crate_graph, db, struct_id.into());
187197
types.push(
@@ -194,7 +204,7 @@ pub fn extract_crate_graph(trap_provider: &trap::TrapFileProvider, db: &RootData
194204
.into(),
195205
);
196206
}
197-
ra_ap_hir::AdtId::EnumId(enum_id) => {
207+
ra_ap_hir_def::AdtId::EnumId(enum_id) => {
198208
let data = db.enum_data(enum_id);
199209
let variants = data
200210
.variants
@@ -222,7 +232,7 @@ pub fn extract_crate_graph(trap_provider: &trap::TrapFileProvider, db: &RootData
222232
.into(),
223233
);
224234
}
225-
ra_ap_hir::AdtId::UnionId(union_id) => {
235+
ra_ap_hir_def::AdtId::UnionId(union_id) => {
226236
let content =
227237
emit_variant_data(trap, crate_graph, db, union_id.into());
228238
types.push(
@@ -520,13 +530,15 @@ fn emit_hir_ty(
520530
chalk_ir::TyKind::Adt(adt_id, _substitution) => {
521531
let mut path = make_path(crate_graph, db, adt_id.0);
522532
let name = match adt_id.0 {
523-
ra_ap_hir::AdtId::StructId(struct_id) => {
533+
ra_ap_hir_def::AdtId::StructId(struct_id) => {
524534
db.struct_data(struct_id).name.as_str().to_owned()
525535
}
526-
ra_ap_hir::AdtId::UnionId(union_id) => {
536+
ra_ap_hir_def::AdtId::UnionId(union_id) => {
527537
db.union_data(union_id).name.as_str().to_owned()
528538
}
529-
ra_ap_hir::AdtId::EnumId(enum_id) => db.enum_data(enum_id).name.as_str().to_owned(),
539+
ra_ap_hir_def::AdtId::EnumId(enum_id) => {
540+
db.enum_data(enum_id).name.as_str().to_owned()
541+
}
530542
};
531543
path.push(name);
532544
trap.emit(generated::PathType {

0 commit comments

Comments
 (0)