Sign in
rust
/
rust
/
HEAD
/
.
/
tests
/
ui
/
borrowck
/
borrow-immutable-deref-box.rs
blob: 6d4932b5b4b5da277c1d948b0d4737a8985af9d2 [
file
] [
log
] [
blame
]
//! regression test for issue <https://github.com/rust-lang/rust/issues/36400>
fn
f
(
x
:
&
mut
u32
)
{}
fn
main
()
{
let
x
=
Box
::
new
(
3
);
f
(&
mut
*
x
);
//~ ERROR cannot borrow `*x` as mutable, as `x` is not declared as mutable
}