Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/find_path.rs')
-rw-r--r--crates/hir-def/src/find_path.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/crates/hir-def/src/find_path.rs b/crates/hir-def/src/find_path.rs
index 2a1b7f7cb0..6aaf8a674e 100644
--- a/crates/hir-def/src/find_path.rs
+++ b/crates/hir-def/src/find_path.rs
@@ -142,9 +142,7 @@ fn find_path_inner(ctx: &FindPathCtx<'_>, item: ItemInNs, max_len: usize) -> Opt
// - if the item is an enum variant, refer to it via the enum
let loc = variant.lookup(ctx.db);
if let Some(mut path) = find_path_inner(ctx, ItemInNs::Types(loc.parent.into()), max_len) {
- path.push_segment(
- loc.parent.enum_variants(ctx.db).variants[loc.index as usize].1.clone(),
- );
+ path.push_segment(loc.name.clone());
return Some(path);
}
// If this doesn't work, it seems we have no way of referring to the