]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/stable_sort_primitive.fixed
Fix type checks for `manual_str_repeat`
[rust.git] / tests / ui / stable_sort_primitive.fixed
index 8f8f566593152771852c23b33f9902fdea1e31f4..f5f18169df2955047af0cfed6c71fdb7172ef9a1 100644 (file)
@@ -20,7 +20,7 @@ fn main() {
     // Negative examples: behavior changes if made unstable
     let mut vec = vec![1, 3, 2];
     vec.sort_by_key(|i| i / 2);
-    vec.sort_by(|a, b| (a + b).cmp(&b));
+    vec.sort_by(|&a, &b| (a + b).cmp(&b));
     // negative examples - Not of a primitive type
     let mut vec_of_complex = vec![String::from("hello"), String::from("world!")];
     vec_of_complex.sort();