diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.rs | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.rs')
-rw-r--r-- | src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.rs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.rs b/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.rs deleted file mode 100644 index a61d68215..000000000 --- a/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Test that moving on both sides of an `@` pattern is not allowed. - -fn main() { - struct U; // Not copy! - - // Prevent promotion: - fn u() -> U { - U - } - - let a @ b = U; //~ ERROR use of moved value - - let a @ (b, c) = (U, U); //~ ERROR use of partially moved value - - let a @ (b, c) = (u(), u()); //~ ERROR use of partially moved value - - match Ok(U) { - a @ Ok(b) | a @ Err(b) => {} //~ ERROR use of moved value - //~^ ERROR use of moved value - } - - fn fun(a @ b: U) {} //~ ERROR use of moved value - - match [u(), u(), u(), u()] { - xs @ [a, .., b] => {} //~ ERROR use of partially moved value - } - - match [u(), u(), u(), u()] { - xs @ [_, ys @ .., _] => {} //~ ERROR use of partially moved value - } -} |