diff --git a/clippy_lints/src/methods/unnecessary_join.rs b/clippy_lints/src/methods/unnecessary_join.rs
index 973b8a7e6bf..33efa16c300 100644
--- a/clippy_lints/src/methods/unnecessary_join.rs
+++ b/clippy_lints/src/methods/unnecessary_join.rs
@@ -31,7 +31,7 @@ pub(super) fn check<'tcx>(
                 cx,
                 UNNECESSARY_JOIN,
                 span.with_hi(expr.span.hi()),
-                r#"called `.collect<Vec<String>>().join("")` on an iterator"#,
+                r#"called `.collect::<Vec<String>>().join("")` on an iterator"#,
                 "try using",
                 "collect::<String>()".to_owned(),
                 applicability,
diff --git a/tests/ui/unnecessary_join.stderr b/tests/ui/unnecessary_join.stderr
index 0b14b143aff..e919a6d1d8a 100644
--- a/tests/ui/unnecessary_join.stderr
+++ b/tests/ui/unnecessary_join.stderr
@@ -1,4 +1,4 @@
-error: called `.collect<Vec<String>>().join("")` on an iterator
+error: called `.collect::<Vec<String>>().join("")` on an iterator
   --> $DIR/unnecessary_join.rs:11:10
    |
 LL |           .collect::<Vec<String>>()
@@ -8,7 +8,7 @@ LL | |         .join("");
    |
    = note: `-D clippy::unnecessary-join` implied by `-D warnings`
 
-error: called `.collect<Vec<String>>().join("")` on an iterator
+error: called `.collect::<Vec<String>>().join("")` on an iterator
   --> $DIR/unnecessary_join.rs:20:10
    |
 LL |           .collect::<Vec<_>>()