]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/traits/object_safety.rs
Merge pull request #20674 from jbcrail/fix-misspelled-comments
[rust.git] / src / librustc / middle / traits / object_safety.rs
index 60b7a90d27d05221b1febcb2212b93d2845275a3..aaf0d4fcb33ebdbeb63ae910b30a6c2ffeff7ab1 100644 (file)
@@ -178,7 +178,7 @@ fn object_safety_violations_for_method<'tcx>(tcx: &ty::ctxt<'tcx>,
     // The `Self` type is erased, so it should not appear in list of
     // arguments or return type apart from the receiver.
     let ref sig = method.fty.sig;
-    for &input_ty in sig.0.inputs[1..].iter() {
+    for &input_ty in sig.0.inputs.index(&(1..)).iter() {
         if contains_illegal_self_type_reference(tcx, trait_def_id, input_ty) {
             return Some(MethodViolationCode::ReferencesSelf);
         }
@@ -295,7 +295,7 @@ fn repr(&self, tcx: &ty::ctxt<'tcx>) -> String {
             ObjectSafetyViolation::SizedSelf =>
                 format!("SizedSelf"),
             ObjectSafetyViolation::Method(ref m, code) =>
-                format!("Method({},{})", m.repr(tcx), code),
+                format!("Method({},{:?})", m.repr(tcx), code),
         }
     }
 }