Sign in
fuchsia
/
third_party
/
rust
/
d782f09ae0b88a73a69e2fa3169222cdbc47d4ec
/
.
/
src
/
test
/
ui
/
regions
/
regions-infer-borrow-scope.rs
blob: 453973d9c58c34c4b8bb568654e42b6d4fd26aa4 [
file
] [
log
] [
blame
]
// run-pass
#![
allow
(
dead_code
)]
#![
feature
(
box_syntax
)]
struct
Point
{
x
:
isize
,
y
:
isize
}
fn
x_coord
(
p
:
&
Point
)
->
&
isize
{
return
&
p
.
x
;
}
pub
fn
main
()
{
let
p
:
Box
<
_
>
=
box
Point
{
x
:
3
,
y
:
4
};
let
xc
=
x_coord
(&*
p
);
assert_eq
!(*
xc
,
3
);
}