diff options
Diffstat (limited to 'crates/hir/src')
-rw-r--r-- | crates/hir/src/lib.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index e34be7e42..e3ac37e4c 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs | |||
@@ -213,7 +213,7 @@ impl Crate { | |||
213 | Some(TokenTree::Leaf(Leaf::Literal(Literal{ref text, ..}))) => Some(text), | 213 | Some(TokenTree::Leaf(Leaf::Literal(Literal{ref text, ..}))) => Some(text), |
214 | _ => None | 214 | _ => None |
215 | } | 215 | } |
216 | }).flat_map(|t| t).next(); | 216 | }).flatten().next(); |
217 | 217 | ||
218 | doc_url.map(|s| s.trim_matches('"').trim_end_matches('/').to_owned() + "/") | 218 | doc_url.map(|s| s.trim_matches('"').trim_end_matches('/').to_owned() + "/") |
219 | } | 219 | } |
@@ -2068,7 +2068,10 @@ impl Type { | |||
2068 | match pred { | 2068 | match pred { |
2069 | WhereClause::Implemented(trait_ref) => { | 2069 | WhereClause::Implemented(trait_ref) => { |
2070 | cb(type_.clone()); | 2070 | cb(type_.clone()); |
2071 | walk_substs(db, type_, &trait_ref.substitution, cb); | 2071 | // skip the self type. it's likely the type we just got the bounds from |
2072 | for ty in trait_ref.substitution.iter().skip(1) { | ||
2073 | walk_type(db, &type_.derived(ty.clone()), cb); | ||
2074 | } | ||
2072 | } | 2075 | } |
2073 | _ => (), | 2076 | _ => (), |
2074 | } | 2077 | } |