Overhaul Const
.
Specifically, rename the `Const` struct as `ConstS` and re-introduce `Const` as this: ``` pub struct Const<'tcx>(&'tcx Interned<ConstS>); ``` This now matches `Ty` and `Predicate` more closely, including using pointer-based `eq` and `hash`. Notable changes: - `mk_const` now takes a `ConstS`. - `Const` was copy, despite being 48 bytes. Now `ConstS` is not, so need a we need separate arena for it, because we can't use the `Dropless` one any more. - Many `&'tcx Const<'tcx>`/`&Const<'tcx>` to `Const<'tcx>` changes - Many `ct.ty` to `ct.ty()` and `ct.val` to `ct.val()` changes. - Lots of tedious sigil fiddling.
This commit is contained in:
parent
7eb15509ce
commit
a95fb8b150
116 changed files with 654 additions and 619 deletions
|
@ -200,7 +200,7 @@ macro_rules! make_mir_visitor {
|
|||
}
|
||||
|
||||
fn visit_const(&mut self,
|
||||
constant: & $($mutability)? &'tcx ty::Const<'tcx>,
|
||||
constant: $(& $mutability)? ty::Const<'tcx>,
|
||||
_: Location) {
|
||||
self.super_const(constant);
|
||||
}
|
||||
|
@ -864,7 +864,7 @@ macro_rules! make_mir_visitor {
|
|||
self.visit_span(span);
|
||||
drop(user_ty); // no visit method for this
|
||||
match literal {
|
||||
ConstantKind::Ty(ct) => self.visit_const(ct, location),
|
||||
ConstantKind::Ty(ct) => self.visit_const($(& $mutability)? *ct, location),
|
||||
ConstantKind::Val(_, ty) => self.visit_ty($(& $mutability)? *ty, TyContext::Location(location)),
|
||||
}
|
||||
}
|
||||
|
@ -903,7 +903,7 @@ macro_rules! make_mir_visitor {
|
|||
fn super_region(&mut self, _region: $(& $mutability)? ty::Region<'tcx>) {
|
||||
}
|
||||
|
||||
fn super_const(&mut self, _const: & $($mutability)? &'tcx ty::Const<'tcx>) {
|
||||
fn super_const(&mut self, _const: $(& $mutability)? ty::Const<'tcx>) {
|
||||
}
|
||||
|
||||
fn super_substs(&mut self, _substs: & $($mutability)? SubstsRef<'tcx>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue