≈ the.bay.news

Confusing compiller error message when [`FnOnce`] closure moves captured ownership-value out of self

The Rust Programming Language Forum
Confusing compiller error message when [`FnOnce`] closure moves captured ownership-value out of self
Hi! I'm trying to understand the compiler error, see some ambiguity here. Perhaps it's just a language issue. English isn't my native. If I run the example from the link above, I get the error: closure is FnOnce because it moves the variable bob out of its environment. I also tried to simulate the closure to better understand what's going on, because, in my opinion, moving ownership of the captured variable to a variable declared within the closure body isn't so obvious. I'm confused by ...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.