]> git.lizzy.rs Git - rust.git/blob - library/core/tests/clone.rs
Rollup merge of #96412 - ChrisDenton:remove-dir-all, r=thomcc
[rust.git] / library / core / tests / clone.rs
1 #[test]
2 fn test_borrowed_clone() {
3     let x = 5;
4     let y: &i32 = &x;
5     let z: &i32 = (&y).clone();
6     assert_eq!(*z, 5);
7 }
8
9 #[test]
10 fn test_clone_from() {
11     let a = Box::new(5);
12     let mut b = Box::new(10);
13     b.clone_from(&a);
14     assert_eq!(*b, 5);
15 }