]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/variance.rs
std: Rename Show/String to Debug/Display
[rust.git] / src / librustc_typeck / variance.rs
index 393ba19ba182ab2ae54f0f048dd11a6a5f11b06b..1f10f8eb1b60d0dc2d49b0412ac07e310df9a371 100644 (file)
@@ -240,7 +240,7 @@ enum VarianceTerm<'a> {
     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),
@@ -288,7 +288,7 @@ fn determine_parameters_to_be_inferred<'a, 'tcx>(tcx: &'a ty::ctxt<'tcx>,
     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
@@ -562,9 +562,9 @@ fn inferred_index(&self, param_id: ast::NodeId) -> InferredIndex {
         match self.terms_cx.inferred_map.get(&param_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))[]);
             }
         }
     }
@@ -837,9 +837,9 @@ fn add_constraints_from_ty(&mut self,
 
             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()))[]);
             }
         }
     }
@@ -917,9 +917,9 @@ fn add_constraints_from_region(&mut self,
                 // 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()))[]);
             }
         }
     }
@@ -1055,7 +1055,7 @@ fn write(&self) {
             // 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()