Sign in
fuchsia
/
third_party
/
rust
/
7de9402b77ded0d8ec9e1c554521b2121449ef2b
/
.
/
src
/
test
/
ui
/
in-band-lifetimes
/
mut_while_borrow.rs
blob: 97e8ed0d2813e7c45eeccbf5c629052cf735530f [
file
] [
log
] [
blame
]
#![
allow
(
warnings
)]
#![
feature
(
in_band_lifetimes
)]
fn
foo
(
x
:
&
'a u32) -> &'
a u32
{
x
}
fn
main
()
{
let
mut
p
=
3
;
let
r
=
foo
(&
p
);
p
+=
1
;
//~ ERROR cannot assign to `p` because it is borrowed
println
!(
"{}"
,
r
);
}