2 // Test that `Clone` is correctly implemented for builtin types.
3 // Also test that cloning an array or a tuple is done right, i.e.
4 // each component is cloned.
6 fn test_clone<T: Clone>(arg: T) {
12 #[derive(Debug, PartialEq, Eq)]
16 fn clone(&self) -> Self {
24 test_clone((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1));
26 let a = [S(0), S(1), S(2)];
27 let b = [S(1), S(2), S(3)];
28 assert_eq!(b, a.clone());
44 assert_eq!(b, a.clone());