Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
regions
/
regions-infer-borrow-scope.rs
blob: 2f25d0010833b01fc533e3bd5eeefadf5892ec1b [
file
] [
log
] [
blame
] [
edit
]
//@ run-pass
#![
allow
(
dead_code
)]
struct
Point
{
x
:
isize
,
y
:
isize
}
fn
x_coord
(
p
:
&
Point
)
->
&
isize
{
return
&
p
.
x
;
}
pub
fn
main
()
{
let
p
:
Box
<
_
>
=
Box
::
new
(
Point
{
x
:
3
,
y
:
4
});
let
xc
=
x_coord
(&*
p
);
assert_eq
!(*
xc
,
3
);
}