Auto merge of #13257 - rust-lang:revert-13147-fix/dyn-ty-inherent-methods, r=lnicola

fix: Fix a crash introduced in #13147

Reverts rust-lang/rust-analyzer#13147

4898678721 (step):18:62
This commit is contained in:
bors 2022-09-19 09:46:21 +00:00
commit 187bee0bb1

View file

@ -989,17 +989,18 @@ fn iterate_inherent_methods(
)?; )?;
} }
TyKind::Dyn(_) => { TyKind::Dyn(_) => {
let principal_trait = self_ty.dyn_trait().unwrap(); if let Some(principal_trait) = self_ty.dyn_trait() {
let traits = all_super_traits(db.upcast(), principal_trait); let traits = all_super_traits(db.upcast(), principal_trait);
iterate_inherent_trait_methods( iterate_inherent_trait_methods(
self_ty, self_ty,
table, table,
name, name,
receiver_ty, receiver_ty,
receiver_adjustments.clone(), receiver_adjustments.clone(),
callback, callback,
traits.into_iter(), traits.into_iter(),
)?; )?;
}
} }
_ => {} _ => {}
} }