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
|
@ -84,6 +84,12 @@ impl IntoArgs for (CrateNum, DefId) {
|
|||
}
|
||||
}
|
||||
|
||||
impl IntoArgs for ty::InstanceDef<'tcx> {
|
||||
fn into_args(self) -> (DefId, DefId) {
|
||||
(self.def_id(), self.def_id())
|
||||
}
|
||||
}
|
||||
|
||||
provide! { <'tcx> tcx, def_id, other, cdata,
|
||||
type_of => { cdata.get_type(def_id.index, tcx) }
|
||||
generics_of => { cdata.get_generics(def_id.index, tcx.sess) }
|
||||
|
|
|
@ -1320,7 +1320,9 @@ impl EncodeContext<'a, 'tcx> {
|
|||
}
|
||||
record!(self.tables.promoted_mir[def_id.to_def_id()] <- self.tcx.promoted_mir(def_id));
|
||||
|
||||
let unused = self.tcx.unused_generic_params(def_id);
|
||||
let instance =
|
||||
ty::InstanceDef::Item(ty::WithOptConstParam::unknown(def_id.to_def_id()));
|
||||
let unused = self.tcx.unused_generic_params(instance);
|
||||
if !unused.is_empty() {
|
||||
record!(self.tables.unused_generic_params[def_id.to_def_id()] <- unused);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue