nandi/rustnimpublic Fork 0
8354895601e0a0fa3e1962b9ef728d00050ffb97
Commits
Clone
git clone https://git.rickub.com/nandi/rustnim.git
git clone ssh://git@rickub.com/nandi/rustnim.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

904-reject-move-closure.rs · 9 lines · 298 BRust Blame HistoryRaw
Add closures and unsafe; base16ct's lower.rs and upper.rs go through 0a375d8 nandithebull 9h ago1//@ reject: captures by value
2// Nim's closures capture by reference, as Rust's non-`move` closures do. A
3// `move` closure is a different thing, so it is not lowered to the same
4// construct.
5fn main() {
6 let v: Vec<i32> = vec![1, 2, 3];
7 let f = move || v.len();
8 println!("{}", f());
9}