InferredTerm(InferredIndex),
}
-impl<'a> fmt::Show for VarianceTerm<'a> {
+impl<'a> fmt::Debug for VarianceTerm<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ConstantTerm(c1) => write!(f, "{:?}", c1),
let mut terms_cx = TermsContext {
tcx: tcx,
arena: arena,
- inferred_map: NodeMap::new(),
+ inferred_map: NodeMap(),
inferred_infos: Vec::new(),
// cache and share the variance struct used for items with
match self.terms_cx.inferred_map.get(¶m_id) {
Some(&index) => index,
None => {
- self.tcx().sess.bug(format!(
+ self.tcx().sess.bug(&format!(
"no inferred index entry for {}",
- self.tcx().map.node_to_string(param_id)).index(&FullRange));
+ self.tcx().map.node_to_string(param_id))[]);
}
}
}
ty::ty_infer(..) | ty::ty_err => {
self.tcx().sess.bug(
- format!("unexpected type encountered in \
+ &format!("unexpected type encountered in \
variance inference: {}",
- ty.repr(self.tcx())).index(&FullRange));
+ ty.repr(self.tcx()))[]);
}
}
}
// regions when visiting member types or method types.
self.tcx()
.sess
- .bug(format!("unexpected region encountered in variance \
+ .bug(&format!("unexpected region encountered in variance \
inference: {}",
- region.repr(self.tcx())).index(&FullRange));
+ region.repr(self.tcx()))[]);
}
}
}
// attribute and report an error with various results if found.
if ty::has_attr(tcx, item_def_id, "rustc_variance") {
let found = item_variances.repr(tcx);
- tcx.sess.span_err(tcx.map.span(item_id), found.index(&FullRange));
+ tcx.sess.span_err(tcx.map.span(item_id), &found[]);
}
let newly_added = tcx.item_variance_map.borrow_mut()