| ▲ | stingraycharles 14 hours ago | ||||||||||||||||||||||
I don’t think this is particularly insightful, as move semantics and r-values are higher level language semantics, nothing more and nothing less. Rust’s borrow checker doesn’t actually borrow anything either, it’s operating on a similar level of abstraction. | |||||||||||||||||||||||
| ▲ | masklinn 13 hours ago | parent [-] | ||||||||||||||||||||||
> Rust’s borrow checker doesn’t actually borrow anything either Why would it? It's called the borrow checker, not the borrower. So it checks that your borrows are valid. std::move looks and feels like a function, but it doesn't do what it says, it makes objects movable but does never moves them (that's up to whatever is using the value afterwards). If you want something similar in Rust, Pin is a much better candidate. | |||||||||||||||||||||||
| |||||||||||||||||||||||