Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
unboxed-closures
/
unboxed-closures-infer-fnmut-missing-mut.rs
blob: 5c0ceb23d614cbb68d5e97cdeaf83d365bd953c2 [
file
] [
log
] [
blame
] [
edit
]
// Test that we are able to infer a suitable kind for this closure
// that is just called (`FnMut`).
fn
main
()
{
let
mut
counter
=
0
;
let
tick
=
||
counter
+=
1
;
tick
();
//~ ERROR cannot borrow `tick` as mutable, as it is not declared as mutable
}