Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/display.rs')
-rw-r--r--crates/hir/src/display.rs18
1 files changed, 12 insertions, 6 deletions
diff --git a/crates/hir/src/display.rs b/crates/hir/src/display.rs
index 9275f45d88..959d62d595 100644
--- a/crates/hir/src/display.rs
+++ b/crates/hir/src/display.rs
@@ -132,12 +132,18 @@ impl HirDisplay for Function {
} else {
match &data.types_map[data.ret_type] {
TypeRef::ImplTrait(bounds) => match &bounds[0] {
- TypeBound::Path(path, _) => Some(
- *path.segments().iter().last().unwrap().args_and_bindings.unwrap().bindings
- [0]
- .type_ref
- .as_ref()
- .unwrap(),
+ &TypeBound::Path(path, _) => Some(
+ *data.types_map[path]
+ .segments()
+ .iter()
+ .last()
+ .unwrap()
+ .args_and_bindings
+ .unwrap()
+ .bindings[0]
+ .type_ref
+ .as_ref()
+ .unwrap(),
),
_ => None,
},