2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2015-01-08 02:25:56 +01:00
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2021-08-25 02:39:40 +02:00
|
|
|
let mut i: Box<_> = Box::new(1);
|
2011-09-22 13:39:03 -07:00
|
|
|
// Should be a copy
|
2012-03-22 08:39:41 -07:00
|
|
|
let mut j;
|
2013-03-15 18:27:15 -04:00
|
|
|
j = i.clone();
|
2011-09-22 13:39:03 -07:00
|
|
|
*i = 2;
|
|
|
|
*j = 3;
|
2013-05-18 22:02:45 -04:00
|
|
|
assert_eq!(*i, 2);
|
|
|
|
assert_eq!(*j, 3);
|
2012-12-05 16:51:32 -08:00
|
|
|
}
|