]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/autoderef.rs
Various minor/cosmetic improvements to code
[rust.git] / src / librustc_typeck / check / autoderef.rs
index 743a2390ec43d5a9fcac17d62f0e0f4f689c0646..1b594342c9a7179944fc9f42c7c2fec7f6a476b5 100644 (file)
@@ -59,15 +59,15 @@ fn next(&mut self) -> Option<Self::Item> {
         if self.steps.len() >= *tcx.sess.recursion_limit.get() {
             // We've reached the recursion limit, error gracefully.
             let suggested_limit = *tcx.sess.recursion_limit.get() * 2;
-            let msg = format!("reached the recursion limit while auto-dereferencing {:?}",
+            let msg = format!("reached the recursion limit while auto-dereferencing `{:?}`",
                               self.cur_ty);
-            let error_id = (DiagnosticMessageId::ErrorId(55), Some(self.span), msg.clone());
+            let error_id = (DiagnosticMessageId::ErrorId(55), Some(self.span), msg);
             let fresh = tcx.sess.one_time_diagnostics.borrow_mut().insert(error_id);
             if fresh {
                 struct_span_err!(tcx.sess,
                                  self.span,
                                  E0055,
-                                 "reached the recursion limit while auto-dereferencing {:?}",
+                                 "reached the recursion limit while auto-dereferencing `{:?}`",
                                  self.cur_ty)
                     .span_label(self.span, "deref recursion limit reached")
                     .help(&format!(
@@ -203,7 +203,7 @@ pub fn adjust_steps_as_infer_ok(&self, needs: Needs)
     }
 
     /// also dereference through raw pointer types
-    /// e.g. assuming ptr_to_Foo is the type `*const Foo`
+    /// e.g., assuming ptr_to_Foo is the type `*const Foo`
     /// fcx.autoderef(span, ptr_to_Foo)  => [*const Foo]
     /// fcx.autoderef(span, ptr_to_Foo).include_raw_ptrs() => [*const Foo, Foo]
     pub fn include_raw_pointers(mut self) -> Self {