about summary refs log tree commit diff
path: root/tests/ui/mut
diff options
context:
space:
mode:
authorJules Bertholet <julesbertholet@quoi.xyz>2024-03-23 21:04:45 -0400
committerJules Bertholet <julesbertholet@quoi.xyz>2024-03-27 09:53:23 -0400
commite0da13f25fd223ee1ec20284ea3f4e88a818b804 (patch)
tree4334e8cf26794e1cd4db3c0a8bf2e8e83d936177 /tests/ui/mut
parent10a7aa14fed9b528b74b0f098c4899c37c09a9c7 (diff)
downloadrust-e0da13f25fd223ee1ec20284ea3f4e88a818b804.tar.gz
rust-e0da13f25fd223ee1ec20284ea3f4e88a818b804.zip
Implement `mut ref`/`mut ref mut`
Diffstat (limited to 'tests/ui/mut')
-rw-r--r--tests/ui/mut/mut-ref.rs10
-rw-r--r--tests/ui/mut/mut-ref.stderr8
2 files changed, 8 insertions, 10 deletions
diff --git a/tests/ui/mut/mut-ref.rs b/tests/ui/mut/mut-ref.rs
index 80990b2bfde..813c7f02df1 100644
--- a/tests/ui/mut/mut-ref.rs
+++ b/tests/ui/mut/mut-ref.rs
@@ -1,4 +1,10 @@
+//@ check-pass
+
 fn main() {
-    let mut ref x = 10; //~ ERROR the order of `mut` and `ref` is incorrect
-    let ref mut y = 11;
+    let mut ref x = 10;
+    x = &11;
+    let ref mut y = 12;
+    *y = 13;
+    let mut ref mut z = 14;
+    z = &mut 15;
 }
diff --git a/tests/ui/mut/mut-ref.stderr b/tests/ui/mut/mut-ref.stderr
deleted file mode 100644
index b91392f223a..00000000000
--- a/tests/ui/mut/mut-ref.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: the order of `mut` and `ref` is incorrect
-  --> $DIR/mut-ref.rs:2:9
-   |
-LL |     let mut ref x = 10;
-   |         ^^^^^^^ help: try switching the order: `ref mut`
-
-error: aborting due to 1 previous error
-