about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src
diff options
context:
space:
mode:
authorDavid Wood <david.wood@huawei.com>2021-10-01 17:08:06 +0000
committerDavid Wood <david.wood@huawei.com>2021-10-01 17:08:06 +0000
commit76b05531cab9bc24a54791b46b5bb9a7c3dcdd7c (patch)
tree0ade4d9fac829bbf1b14af0437540c3546c11de1 /compiler/rustc_const_eval/src
parent4528b8e581eb1bb24f4f264d43244d7912f812f7 (diff)
downloadrust-76b05531cab9bc24a54791b46b5bb9a7c3dcdd7c.tar.gz
rust-76b05531cab9bc24a54791b46b5bb9a7c3dcdd7c.zip
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>
Diffstat (limited to 'compiler/rustc_const_eval/src')
-rw-r--r--compiler/rustc_const_eval/src/interpret/util.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/util.rs b/compiler/rustc_const_eval/src/interpret/util.rs
index eb0fdebb665..a16388d5de2 100644
--- a/compiler/rustc_const_eval/src/interpret/util.rs
+++ b/compiler/rustc_const_eval/src/interpret/util.rs
@@ -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()