]> git.proxmox.com Git - rustc.git/blame - src/libcore/tests/clone.rs
New upstream version 1.33.0+dfsg1
[rustc.git] / src / libcore / tests / clone.rs
CommitLineData
1a4d82fc
JJ
1#[test]
2fn test_borrowed_clone() {
85aaf69f 3 let x = 5;
b039eaaf
SL
4 let y: &i32 = &x;
5 let z: &i32 = (&y).clone();
1a4d82fc
JJ
6 assert_eq!(*z, 5);
7}
8
9#[test]
10fn test_clone_from() {
85aaf69f
SL
11 let a = box 5;
12 let mut b = box 10;
1a4d82fc
JJ
13 b.clone_from(&a);
14 assert_eq!(*b, 5);
15}