about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexis Bourget <alexis.bourget@gmail.com>2020-09-13 18:59:18 +0200
committerAlexis Bourget <alexis.bourget@gmail.com>2020-09-21 21:50:27 +0200
commit5be843fc54f80817c88438efa097a4ba81d4aa9e (patch)
tree5403a624849d8a7888c4d8e0c9a68b2658e072a7
parentf6a4189d05f8bc7091450289f7285819ebdd3c62 (diff)
downloadrust-5be843fc54f80817c88438efa097a4ba81d4aa9e.tar.gz
rust-5be843fc54f80817c88438efa097a4ba81d4aa9e.zip
Move format-ref-cell test
-rw-r--r--library/core/tests/cell.rs8
-rw-r--r--src/test/ui/format-ref-cell.rs10
2 files changed, 8 insertions, 10 deletions
diff --git a/library/core/tests/cell.rs b/library/core/tests/cell.rs
index 796c937eaff..40be01f4439 100644
--- a/library/core/tests/cell.rs
+++ b/library/core/tests/cell.rs
@@ -414,3 +414,11 @@ fn refcell_replace_borrows() {
     let _b = x.borrow();
     x.replace(1);
 }
+
+#[test]
+fn refcell_format() {
+    let name = RefCell::new("rust");
+    let what = RefCell::new("rocks");
+    let msg = format!("{name} {}", &*what.borrow(), name = &*name.borrow());
+    assert_eq!(msg, "rust rocks".to_string());
+}
diff --git a/src/test/ui/format-ref-cell.rs b/src/test/ui/format-ref-cell.rs
deleted file mode 100644
index afb2f8488b8..00000000000
--- a/src/test/ui/format-ref-cell.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-// run-pass
-
-use std::cell::RefCell;
-
-pub fn main() {
-    let name = RefCell::new("rust");
-    let what = RefCell::new("rocks");
-    let msg = format!("{name} {}", &*what.borrow(), name=&*name.borrow());
-    assert_eq!(msg, "rust rocks".to_string());
-}