diff options
| author | Alexis Bourget <alexis.bourget@gmail.com> | 2020-09-13 18:59:18 +0200 |
|---|---|---|
| committer | Alexis Bourget <alexis.bourget@gmail.com> | 2020-09-21 21:50:27 +0200 |
| commit | 5be843fc54f80817c88438efa097a4ba81d4aa9e (patch) | |
| tree | 5403a624849d8a7888c4d8e0c9a68b2658e072a7 | |
| parent | f6a4189d05f8bc7091450289f7285819ebdd3c62 (diff) | |
| download | rust-5be843fc54f80817c88438efa097a4ba81d4aa9e.tar.gz rust-5be843fc54f80817c88438efa097a4ba81d4aa9e.zip | |
Move format-ref-cell test
| -rw-r--r-- | library/core/tests/cell.rs | 8 | ||||
| -rw-r--r-- | src/test/ui/format-ref-cell.rs | 10 |
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()); -} |
