Add generic consts to BottomUpFolder

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
This commit is contained in:
varkor 2019-03-08 01:15:23 +00:00
parent 77447deb21
commit d7fdeffafc
4 changed files with 60 additions and 14 deletions

View file

@ -676,8 +676,7 @@ impl<'a, 'gcx, 'tcx> Instantiator<'a, 'gcx, 'tcx> {
let tcx = self.infcx.tcx;
value.fold_with(&mut BottomUpFolder {
tcx,
reg_op: |reg| reg,
fldop: |ty| {
ty_op: |ty| {
if let ty::Opaque(def_id, substs) = ty.sty {
// Check that this is `impl Trait` type is
// declared by `parent_def_id` -- i.e., one whose
@ -776,6 +775,8 @@ impl<'a, 'gcx, 'tcx> Instantiator<'a, 'gcx, 'tcx> {
ty
},
lt_op: |lt| lt,
ct_op: |ct| ct,
})
}