]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/util/ppaux.rs
remove unnecessary parentheses from range notation
[rust.git] / src / librustc / util / ppaux.rs
index 1a1ad899d4e82bd281b1f53fe8801ce007ff9399..1be6c84f8e9ff0971fe4cee208b8a3debf71c419 100644 (file)
@@ -542,7 +542,7 @@ pub fn parameterized<'tcx>(cx: &ctxt<'tcx>,
         0
     };
 
-    for t in tps[..(tps.len() - num_defaults)].iter() {
+    for t in tps[..tps.len() - num_defaults].iter() {
         strs.push(ty_to_string(cx, *t))
     }
 
@@ -550,9 +550,9 @@ pub fn parameterized<'tcx>(cx: &ctxt<'tcx>,
         format!("{}({}){}",
                 base,
                 if strs[0].starts_with("(") && strs[0].ends_with(",)") {
-                    &strs[0][1 .. (strs[0].len() - 2)] // Remove '(' and ',)'
+                    &strs[0][1 .. strs[0].len() - 2] // Remove '(' and ',)'
                 } else if strs[0].starts_with("(") && strs[0].ends_with(")") {
-                    &strs[0][1 .. (strs[0].len() - 1)] // Remove '(' and ')'
+                    &strs[0][1 .. strs[0].len() - 1] // Remove '(' and ')'
                 } else {
                     &strs[0][]
                 },
@@ -1430,7 +1430,7 @@ fn user_string(&self, tcx: &ctxt<'tcx>) -> String {
 impl<'tcx> Repr<'tcx> for ty::ProjectionTy<'tcx> {
     fn repr(&self, tcx: &ctxt<'tcx>) -> String {
         format!("<{} as {}>::{}",
-                self.trait_ref.self_ty().repr(tcx),
+                self.trait_ref.substs.self_ty().repr(tcx),
                 self.trait_ref.repr(tcx),
                 self.item_name.repr(tcx))
     }