diff options
Diffstat (limited to 'crates/ra_hir_ty/src/traits')
-rw-r--r-- | crates/ra_hir_ty/src/traits/builtin.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/ra_hir_ty/src/traits/builtin.rs b/crates/ra_hir_ty/src/traits/builtin.rs index 19e533cee..df0645717 100644 --- a/crates/ra_hir_ty/src/traits/builtin.rs +++ b/crates/ra_hir_ty/src/traits/builtin.rs | |||
@@ -316,12 +316,10 @@ fn super_trait_object_unsize_impl_datum( | |||
316 | let self_bounds = vec![GenericPredicate::Implemented(self_trait_ref.clone())]; | 316 | let self_bounds = vec![GenericPredicate::Implemented(self_trait_ref.clone())]; |
317 | 317 | ||
318 | // we need to go from our trait to the super trait, substituting type parameters | 318 | // we need to go from our trait to the super trait, substituting type parameters |
319 | let mut path = crate::utils::find_super_trait_path(db, data.super_trait, data.trait_); | 319 | let path = crate::utils::find_super_trait_path(db, data.trait_, data.super_trait); |
320 | path.pop(); // the last one is our current trait, we don't need that | ||
321 | path.reverse(); // we want to go from trait to super trait | ||
322 | 320 | ||
323 | let mut current_trait_ref = self_trait_ref; | 321 | let mut current_trait_ref = self_trait_ref; |
324 | for t in path { | 322 | for t in path.into_iter().skip(1) { |
325 | let bounds = db.generic_predicates(current_trait_ref.trait_.into()); | 323 | let bounds = db.generic_predicates(current_trait_ref.trait_.into()); |
326 | let super_trait_ref = bounds | 324 | let super_trait_ref = bounds |
327 | .iter() | 325 | .iter() |