mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-05 03:23:25 +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
|
||||
where T: TypeFoldable<'tcx> + ty::Lift<'gcx>
|
||||
{
|
||||
debug!("drain_fulfillment_cx_or_panic()");
|
||||
|
||||
let when = "resolving bounds after type-checking";
|
||||
let v = match self.drain_fulfillment_cx(fulfill_cx, result) {
|
||||
Ok(v) => v,
|
||||
@ -817,6 +819,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
|
||||
}
|
||||
|
||||
fn start_snapshot(&self) -> CombinedSnapshot {
|
||||
debug!("start_snapshot()");
|
||||
|
||||
let obligations_in_snapshot = self.obligations_in_snapshot.get();
|
||||
self.obligations_in_snapshot.set(false);
|
||||
|
||||
@ -854,7 +858,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
|
||||
}
|
||||
|
||||
fn commit_from(&self, snapshot: CombinedSnapshot) {
|
||||
debug!("commit_from!");
|
||||
debug!("commit_from()");
|
||||
let CombinedSnapshot { type_snapshot,
|
||||
int_snapshot,
|
||||
float_snapshot,
|
||||
|
@ -178,7 +178,9 @@ impl<'tcx> TypeVariableTable<'tcx> {
|
||||
value: Bounded { relations: vec![], default: default },
|
||||
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 {
|
||||
@ -219,6 +221,17 @@ impl<'tcx> TypeVariableTable<'tcx> {
|
||||
}
|
||||
|
||||
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.eq_relations.rollback_to(s.eq_snapshot);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user