Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
unboxed-closures
/
unboxed-closures-infer-upvar.rs
blob: a78992f66e076dc98e12dbde6f87c057b201c628 [
file
] [
log
] [
blame
] [
edit
]
//@ run-pass
// Test that the type variable in the type(`Vec<_>`) of a closed over
// variable does not interfere with type inference.
fn
f
<
F
:
FnMut
()>(
mut
f
:
F
)
{
f
();
}
fn
main
()
{
let
mut
v
:
Vec
<
_
>
=
vec
![];
f
(||
v
.
push
(
0
));
assert_eq
!(
v
,
[
0
]);
}