IdentitySubsts::identity_for_item takes Into<DefId>

This commit is contained in:
Michael Goulet 2023-03-13 19:35:29 +00:00
parent 979ef5981f
commit 7e6506764b
14 changed files with 27 additions and 28 deletions

View file

@ -18,7 +18,7 @@ pub(crate) fn check<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>) {
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]
&InternalSubsts::identity_for_item(tcx, def_id)[..trait_substs_count]
}
_ => &[],
};