mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-10 05:53:10 +00:00
better debug dumping with inference variables
This commit is contained in:
parent
75543c08c7
commit
eaf13b2f01
@ -643,6 +643,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
|
|||||||
-> T::Lifted
|
-> T::Lifted
|
||||||
where T: TypeFoldable<'tcx> + ty::Lift<'gcx>
|
where T: TypeFoldable<'tcx> + ty::Lift<'gcx>
|
||||||
{
|
{
|
||||||
|
debug!("drain_fulfillment_cx_or_panic()");
|
||||||
|
|
||||||
let when = "resolving bounds after type-checking";
|
let when = "resolving bounds after type-checking";
|
||||||
let v = match self.drain_fulfillment_cx(fulfill_cx, result) {
|
let v = match self.drain_fulfillment_cx(fulfill_cx, result) {
|
||||||
Ok(v) => v,
|
Ok(v) => v,
|
||||||
@ -817,6 +819,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn start_snapshot(&self) -> CombinedSnapshot {
|
fn start_snapshot(&self) -> CombinedSnapshot {
|
||||||
|
debug!("start_snapshot()");
|
||||||
|
|
||||||
let obligations_in_snapshot = self.obligations_in_snapshot.get();
|
let obligations_in_snapshot = self.obligations_in_snapshot.get();
|
||||||
self.obligations_in_snapshot.set(false);
|
self.obligations_in_snapshot.set(false);
|
||||||
|
|
||||||
@ -854,7 +858,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn commit_from(&self, snapshot: CombinedSnapshot) {
|
fn commit_from(&self, snapshot: CombinedSnapshot) {
|
||||||
debug!("commit_from!");
|
debug!("commit_from()");
|
||||||
let CombinedSnapshot { type_snapshot,
|
let CombinedSnapshot { type_snapshot,
|
||||||
int_snapshot,
|
int_snapshot,
|
||||||
float_snapshot,
|
float_snapshot,
|
||||||
|
@ -178,7 +178,9 @@ impl<'tcx> TypeVariableTable<'tcx> {
|
|||||||
value: Bounded { relations: vec![], default: default },
|
value: Bounded { relations: vec![], default: default },
|
||||||
diverging: diverging
|
diverging: diverging
|
||||||
});
|
});
|
||||||
ty::TyVid { index: index as u32 }
|
let v = ty::TyVid { index: index as u32 };
|
||||||
|
debug!("new_var() -> {:?}", v);
|
||||||
|
v
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn root_var(&mut self, vid: ty::TyVid) -> ty::TyVid {
|
pub fn root_var(&mut self, vid: ty::TyVid) -> ty::TyVid {
|
||||||
@ -219,6 +221,17 @@ impl<'tcx> TypeVariableTable<'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn rollback_to(&mut self, s: Snapshot) {
|
pub fn rollback_to(&mut self, s: Snapshot) {
|
||||||
|
debug!("rollback_to{:?}", {
|
||||||
|
for action in self.values.actions_since_snapshot(&s.snapshot) {
|
||||||
|
match *action {
|
||||||
|
sv::UndoLog::NewElem(index) => {
|
||||||
|
debug!("inference variable _#{}t popped", index)
|
||||||
|
}
|
||||||
|
_ => { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
self.values.rollback_to(s.snapshot);
|
self.values.rollback_to(s.snapshot);
|
||||||
self.eq_relations.rollback_to(s.eq_snapshot);
|
self.eq_relations.rollback_to(s.eq_snapshot);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user