Remove trait_of_item query.
This commit is contained in:
parent
d7ea161b7e
commit
957548183d
10 changed files with 25 additions and 36 deletions
|
@ -14,7 +14,7 @@ pub(crate) fn check<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>) {
|
|||
|
||||
if let DefKind::Fn | DefKind::AssocFn = tcx.def_kind(def_id) {
|
||||
// If this is trait/impl method, extract the trait's substs.
|
||||
let trait_substs = match tcx.trait_of_item(def_id) {
|
||||
let trait_substs = match tcx.trait_of_item(def_id.to_def_id()) {
|
||||
Some(trait_def_id) => {
|
||||
let trait_substs_count = tcx.generics_of(trait_def_id).count();
|
||||
&InternalSubsts::identity_for_item(tcx, def_id.to_def_id())[..trait_substs_count]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue