Skip to content

Commit c71d1f5

Browse files
committed
Implement shim.rs for GenericParamDefKind::Const
1 parent 15a9f4e commit c71d1f5

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/librustc_mir/shim.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc::hir;
1212
use rustc::hir::def_id::DefId;
1313
use rustc::infer;
1414
use rustc::mir::*;
15-
use rustc::ty::{self, Ty, TyCtxt, GenericParamDefKind};
15+
use rustc::ty::{self, Ty, TyCtxt};
1616
use rustc::ty::subst::{Subst, Substs};
1717
use rustc::ty::query::Providers;
1818

@@ -427,14 +427,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> {
427427
cleanup: BasicBlock
428428
) {
429429
let tcx = self.tcx;
430-
431-
let substs = Substs::for_item(tcx, self.def_id, |param, _| {
432-
match param.kind {
433-
GenericParamDefKind::Lifetime => tcx.types.re_erased.into(),
434-
GenericParamDefKind::Type { .. } => ty.into(),
435-
GenericParamDefKind::Const { .. } => unimplemented!(), // TODO(const_generics):
436-
}
437-
});
430+
let substs = tcx.mk_substs_trait(ty, &[]);
438431

439432
// `func == Clone::clone(&ty) -> ty`
440433
let func_ty = tcx.mk_fn_def(self.def_id, substs);

0 commit comments

Comments
 (0)