]> git.lizzy.rs Git - rust.git/commitdiff
Adds the missing turbofish
authorAdam Lusch <alusch@gmail.com>
Mon, 15 Jan 2018 04:19:55 +0000 (20:19 -0800)
committerAdam Lusch <alusch@gmail.com>
Mon, 15 Jan 2018 04:19:55 +0000 (20:19 -0800)
clippy_lints/src/methods.rs
tests/ui/unnecessary_clone.stderr

index 8803c4e3019b67668c1ca23c98378fe551b41f32..8a92e49340f4e3f60d7f1899330144d6b6683fb3 100644 (file)
@@ -1029,7 +1029,7 @@ fn lint_clone_on_ref_ptr(cx: &LateContext, expr: &hir::Expr, arg: &hir::Expr) {
             expr.span,
             "using '.clone()' on a ref-counted pointer",
             "try this",
-            format!("{}<{}>::clone(&{})", caller_type, subst.type_at(0), snippet(cx, arg.span, "_")),
+            format!("{}::<{}>::clone(&{})", caller_type, subst.type_at(0), snippet(cx, arg.span, "_")),
         );
     }
 }
index 298a9393486eb8a0345e012df051ede150699e90..bb78bfa164ea06967e6b8592efb268d80b287a3f 100644 (file)
@@ -16,7 +16,7 @@ error: using '.clone()' on a ref-counted pointer
   --> $DIR/unnecessary_clone.rs:30:5
    |
 30 |     rc.clone();
-   |     ^^^^^^^^^^ help: try this: `Rc<bool>::clone(&rc)`
+   |     ^^^^^^^^^^ help: try this: `Rc::<bool>::clone(&rc)`
    |
    = note: `-D clone-on-ref-ptr` implied by `-D warnings`
 
@@ -24,25 +24,25 @@ error: using '.clone()' on a ref-counted pointer
   --> $DIR/unnecessary_clone.rs:33:5
    |
 33 |     arc.clone();
-   |     ^^^^^^^^^^^ help: try this: `Arc<bool>::clone(&arc)`
+   |     ^^^^^^^^^^^ help: try this: `Arc::<bool>::clone(&arc)`
 
 error: using '.clone()' on a ref-counted pointer
   --> $DIR/unnecessary_clone.rs:36:5
    |
 36 |     rcweak.clone();
-   |     ^^^^^^^^^^^^^^ help: try this: `Weak<bool>::clone(&rcweak)`
+   |     ^^^^^^^^^^^^^^ help: try this: `Weak::<bool>::clone(&rcweak)`
 
 error: using '.clone()' on a ref-counted pointer
   --> $DIR/unnecessary_clone.rs:39:5
    |
 39 |     arc_weak.clone();
-   |     ^^^^^^^^^^^^^^^^ help: try this: `Weak<bool>::clone(&arc_weak)`
+   |     ^^^^^^^^^^^^^^^^ help: try this: `Weak::<bool>::clone(&arc_weak)`
 
 error: using '.clone()' on a ref-counted pointer
   --> $DIR/unnecessary_clone.rs:43:29
    |
 43 |     let _: Arc<SomeTrait> = x.clone(); 
-   |                             ^^^^^^^^^ help: try this: `Arc<SomeImpl>::clone(&x)`
+   |                             ^^^^^^^^^ help: try this: `Arc::<SomeImpl>::clone(&x)`
 
 error: using `clone` on a `Copy` type
   --> $DIR/unnecessary_clone.rs:47:5