2024-02-16 20:02:50 +00:00
|
|
|
//@ run-pass
|
2015-01-08 02:25:56 +01:00
|
|
|
|
2014-07-17 21:44:59 -07:00
|
|
|
fn borrow<T>(x: &T) -> &T {x}
|
2012-07-06 09:14:57 -07:00
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2021-08-25 02:39:40 +02:00
|
|
|
let x: Box<_> = Box::new(3);
|
2012-07-06 09:14:57 -07:00
|
|
|
loop {
|
2014-07-07 16:35:15 -07:00
|
|
|
let y = borrow(&*x);
|
2013-05-18 22:02:45 -04:00
|
|
|
assert_eq!(*x, *y);
|
2013-05-03 19:25:04 -04:00
|
|
|
break;
|
2012-07-06 09:14:57 -07:00
|
|
|
}
|
|
|
|
|
}
|