make PlaceholderConst
not store the type of the const
This commit is contained in:
parent
1f5d8d49eb
commit
825a7cc65c
8 changed files with 13 additions and 13 deletions
|
@ -511,7 +511,7 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for Canonicalizer<'cx, 'tcx> {
|
|||
}
|
||||
ty::ConstKind::Placeholder(placeholder) => {
|
||||
return self.canonicalize_const_var(
|
||||
CanonicalVarInfo { kind: CanonicalVarKind::PlaceholderConst(placeholder) },
|
||||
CanonicalVarInfo { kind: CanonicalVarKind::PlaceholderConst(placeholder, ct.ty()) },
|
||||
ct,
|
||||
);
|
||||
}
|
||||
|
@ -695,11 +695,11 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
|
|||
..placeholder
|
||||
})
|
||||
}
|
||||
CanonicalVarKind::PlaceholderConst(placeholder) => {
|
||||
CanonicalVarKind::PlaceholderConst(placeholder, t) => {
|
||||
CanonicalVarKind::PlaceholderConst(ty::Placeholder {
|
||||
universe: reverse_universe_map[&placeholder.universe],
|
||||
..placeholder
|
||||
})
|
||||
}, t)
|
||||
}
|
||||
},
|
||||
})
|
||||
|
|
|
@ -144,13 +144,13 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
|
|||
)
|
||||
.into(),
|
||||
|
||||
CanonicalVarKind::PlaceholderConst(ty::PlaceholderConst { universe, name }) => {
|
||||
CanonicalVarKind::PlaceholderConst(ty::PlaceholderConst { universe, name }, ty) => {
|
||||
let universe_mapped = universe_map(universe);
|
||||
let placeholder_mapped = ty::PlaceholderConst { universe: universe_mapped, name };
|
||||
self.tcx
|
||||
.mk_const(ty::ConstS {
|
||||
kind: ty::ConstKind::Placeholder(placeholder_mapped),
|
||||
ty: name.ty,
|
||||
ty,
|
||||
})
|
||||
.into()
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
|||
self.tcx.mk_const(ty::ConstS {
|
||||
kind: ty::ConstKind::Placeholder(ty::PlaceholderConst {
|
||||
universe: next_universe,
|
||||
name: ty::BoundConst { var: bound_var, ty },
|
||||
name: bound_var,
|
||||
}),
|
||||
ty,
|
||||
})
|
||||
|
|
|
@ -2069,7 +2069,7 @@ fn replace_param_and_infer_substs_with_placeholder<'tcx>(
|
|||
ty,
|
||||
kind: ty::ConstKind::Placeholder(ty::PlaceholderConst {
|
||||
universe: ty::UniverseIndex::ROOT,
|
||||
name: ty::BoundConst { ty, var: ty::BoundVar::from_usize(idx) },
|
||||
name: ty::BoundVar::from_usize(idx),
|
||||
}),
|
||||
})
|
||||
.into()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue