You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/.../tmp.rs:3:12: 3:13 error: use of moved value: `f`
/.../tmp.rs:3 let h = f;
^
/.../tmp.rs:2:12: 2:13 note: `f` moved here because it has type `&fn<no-bounds>()`, which is moved by default (use `copy` to override)
/.../tmp.rs:2 let g = f;
Similar problem:
fn foo(fs: &[&fn()]) {
let f = fs[0];
}
Fails with:
/.../tmp.rs:2:12: 2:16 error: cannot move out of dereference of & pointer
/.../tmp.rs:2 let f = fs[0];
Because of this it seems to be impossible to iterate over &[&fn()].
The text was updated successfully, but these errors were encountered:
Code:
fails with:
Similar problem:
Fails with:
Because of this it seems to be impossible to iterate over
&[&fn()]
.The text was updated successfully, but these errors were encountered: