add some debug logs to type_variable.rs

This commit is contained in:
Niko Matsakis 2017-03-17 09:35:50 -04:00
parent 4c6c26eba1
commit 555b6d69b2

View File

@ -30,6 +30,7 @@ pub struct TypeVariableTable<'tcx> {
}
/// Reasons to create a type inference variable
#[derive(Debug)]
pub enum TypeVariableOrigin {
MiscVariable(Span),
NormalizeProjectionType(Span),
@ -196,6 +197,7 @@ pub fn new_var(&mut self,
diverging: bool,
origin: TypeVariableOrigin,
default: Option<Default<'tcx>>,) -> ty::TyVid {
debug!("new_var(diverging={:?}, origin={:?})", diverging, origin);
self.eq_relations.new_key(());
let index = self.values.push(TypeVariableData {
value: Bounded { relations: vec![], default: default },
@ -203,7 +205,7 @@ pub fn new_var(&mut self,
diverging: diverging
});
let v = ty::TyVid { index: index as u32 };
debug!("new_var() -> {:?}", v);
debug!("new_var: diverging={:?} index={:?}", diverging, v);
v
}