Skip to content

Commit 5be843f

Browse files
committed
Move format-ref-cell test
1 parent f6a4189 commit 5be843f

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

library/core/tests/cell.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,3 +414,11 @@ fn refcell_replace_borrows() {
414414
let _b = x.borrow();
415415
x.replace(1);
416416
}
417+
418+
#[test]
419+
fn refcell_format() {
420+
let name = RefCell::new("rust");
421+
let what = RefCell::new("rocks");
422+
let msg = format!("{name} {}", &*what.borrow(), name = &*name.borrow());
423+
assert_eq!(msg, "rust rocks".to_string());
424+
}

src/test/ui/format-ref-cell.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)