Add Debug impl and erase region for TypedConstVal
This commit is contained in:
parent
d31027d3bf
commit
9884ff1dfb
@ -891,13 +891,20 @@ pub struct Constant<'tcx> {
|
||||
pub literal: Literal<'tcx>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, RustcEncodable, RustcDecodable)]
|
||||
#[derive(Clone, RustcEncodable, RustcDecodable)]
|
||||
pub struct TypedConstVal<'tcx> {
|
||||
pub ty: Ty<'tcx>,
|
||||
pub span: Span,
|
||||
pub value: ConstVal
|
||||
}
|
||||
|
||||
impl<'tcx> Debug for TypedConstVal<'tcx> {
|
||||
fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
|
||||
try!(write!(fmt, "const "));
|
||||
fmt_const_val(fmt, &self.value)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, RustcEncodable, RustcDecodable)]
|
||||
pub enum ItemKind {
|
||||
Constant,
|
||||
|
@ -143,8 +143,9 @@ impl<'a, 'tcx> EraseRegions<'a, 'tcx> {
|
||||
Rvalue::Use(ref mut operand) => {
|
||||
self.erase_regions_operand(operand)
|
||||
}
|
||||
Rvalue::Repeat(ref mut operand, _) => {
|
||||
Rvalue::Repeat(ref mut operand, ref mut value) => {
|
||||
self.erase_regions_operand(operand);
|
||||
value.ty = self.tcx.erase_regions(&value.ty);
|
||||
}
|
||||
Rvalue::Ref(ref mut region, _, ref mut lvalue) => {
|
||||
*region = ty::ReStatic;
|
||||
|
Loading…
x
Reference in New Issue
Block a user