Closed
Description
struct Foo;
impl Foo {
pub fn init() {
}
}
struct Bar;
fn main() {
let init = Bar;
drop(init);
let foo = move || {
Foo::init();
};
}
Results in
<anon>:14:7: 14:16 error: capture of moved value: `init`
<anon>:14 Foo::init();
^~~~~~~~~
note: in expansion of closure expansion
<anon>:13:20: 15:6 note: expansion site
<anon>:12:10: 12:14 note: `init` moved here because it has type `Bar`, which is non-copyable
<anon>:12 drop(init);
That doesn't make sense.