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-pat-by-move-and-ref-inverse.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-pat-by-move-and-ref-inverse.rs')
-rw-r--r-- | src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.rs | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.rs b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.rs deleted file mode 100644 index 06dc6e1c4..000000000 --- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.rs +++ /dev/null @@ -1,80 +0,0 @@ -// Test that `by_move_binding @ pat_with_by_ref_bindings` is prevented. - -fn main() { - struct U; - - // Prevent promotion. - fn u() -> U { - U - } - - fn f1(a @ ref b: U) {} - //~^ ERROR borrow of moved value - - fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {} - //~^ ERROR borrow of moved value - //~| ERROR borrow of moved value - //~| ERROR borrow of moved value - //~| ERROR use of partially moved value - fn f3(a @ [ref mut b, ref c]: [U; 2]) {} - //~^ ERROR borrow of moved value - - let a @ ref b = U; - //~^ ERROR borrow of moved value - let a @ (mut b @ ref mut c, d @ ref e) = (U, U); - //~^ ERROR borrow of moved value - //~| ERROR borrow of moved value - //~| ERROR borrow of moved value - //~| ERROR use of partially moved value - let a @ [ref mut b, ref c] = [U, U]; - //~^ ERROR borrow of moved value - let a @ ref b = u(); - //~^ ERROR borrow of moved value - let a @ (mut b @ ref mut c, d @ ref e) = (u(), u()); - //~^ ERROR borrow of moved value - //~| ERROR borrow of moved value - //~| ERROR borrow of moved value - //~| ERROR use of partially moved value - let a @ [ref mut b, ref c] = [u(), u()]; - //~^ ERROR borrow of moved value - - match Some(U) { - a @ Some(ref b) => {} - //~^ ERROR borrow of moved value - None => {} - } - match Some((U, U)) { - a @ Some((mut b @ ref mut c, d @ ref e)) => {} - //~^ ERROR borrow of moved value - //~| ERROR borrow of moved value - //~| ERROR borrow of moved value - //~| ERROR use of moved value - None => {} - } - match Some([U, U]) { - mut a @ Some([ref b, ref mut c]) => {} - //~^ ERROR borrow of moved value - //~| ERROR borrow of moved value - None => {} - } - match Some(u()) { - a @ Some(ref b) => {} - //~^ ERROR borrow of moved value - //~| ERROR borrow of moved value - None => {} - } - match Some((u(), u())) { - a @ Some((mut b @ ref mut c, d @ ref e)) => {} - //~^ ERROR borrow of moved value - //~| ERROR borrow of moved value - //~| ERROR borrow of moved value - //~| ERROR use of moved value - None => {} - } - match Some([u(), u()]) { - mut a @ Some([ref b, ref mut c]) => {} - //~^ ERROR borrow of moved value - //~| ERROR borrow of moved value - None => {} - } -} |