polymorphize: polymorphize shims
This commit removes the restriction of `InstanceDef::Item` on polymorphization, so that shims can now be polymorphized. Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
4528b8e581
commit
76b05531ca
7 changed files with 112 additions and 61 deletions
|
@ -35,7 +35,8 @@ where
|
|||
ty::Closure(def_id, substs)
|
||||
| ty::Generator(def_id, substs, ..)
|
||||
| ty::FnDef(def_id, substs) => {
|
||||
let unused_params = self.tcx.unused_generic_params(def_id);
|
||||
let instance = ty::InstanceDef::Item(ty::WithOptConstParam::unknown(def_id));
|
||||
let unused_params = self.tcx.unused_generic_params(instance);
|
||||
for (index, subst) in substs.into_iter().enumerate() {
|
||||
let index = index
|
||||
.try_into()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue