]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/moves/use_of_moved_value_copy_suggestions.fixed
New upstream version 1.62.1+dfsg1
[rustc.git] / src / test / ui / moves / use_of_moved_value_copy_suggestions.fixed
index d31046c77006e1c68dfb8bf9d20edb08370fa996..ba1b745ba84229115cbcd68041bef850ab1f8fa2 100644 (file)
@@ -54,19 +54,33 @@ where
 
 fn duplicate_custom_3<T>(t: S<T>) -> (S<T>, S<T>)
 where
-    T: A,
-    T: B, T: Trait, T: Copy
-    //~^ HELP consider further restricting type parameter `T`
+    T: A + Trait + Copy,
+    //~^ HELP consider further restricting this bound
+    T: B,
 {
     (t, t) //~ use of moved value: `t`
 }
 
-fn duplicate_custom_4<T: A>(t: S<T>) -> (S<T>, S<T>)
+fn duplicate_custom_4<T: A + Trait + Copy>(t: S<T>) -> (S<T>, S<T>)
+//~^ HELP consider further restricting this bound
 where
-    T: B + Trait + Copy,
-    //~^ HELP consider further restricting this bound
+    T: B,
 {
     (t, t) //~ use of moved value: `t`
 }
 
+#[rustfmt::skip]
+fn existing_colon<T: Copy>(t: T) {
+    //~^ HELP consider restricting type parameter `T`
+    [t, t]; //~ use of moved value: `t`
+}
+
+fn existing_colon_in_where<T>(t: T)
+where
+    T:, T: Copy
+    //~^ HELP consider further restricting type parameter `T`
+{
+    [t, t]; //~ use of moved value: `t`
+}
+
 fn main() {}