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
fn main(){
let mut v = ~[1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,];
log(error, v);
log(error, v); // nope
}
The above code fails to compile:
view.rs:4:15: 4:16 error: use of moved variable: `v`
view.rs:4 log(error, v);
^
view.rs:3:15: 3:16 note: move of variable occurred here
view.rs:3 log(error, v);
^
error: aborting due to previous error
13:00 < bstrie> nmatsakis: also, I've noticed that
https://gist.github.com/4566644 is an error because v is moved
out, and I'm wondering if that's intentional
13:01 < nmatsakis> bstrie: hmm, I can see why it happens but it does seem
non-ideal. I'm working on a total rewrite of the module
that decides what's a move and what's not.
13:01 < nmatsakis> it could no doubt be made smarter around log
13:01 < bstrie> ah, okay
13:01 < bstrie> I just feel like log should be "transparent" in that respect
13:02 < nmatsakis> yes
13:02 < nmatsakis> I agree
13:02 < nmatsakis> it doesn't "consume" it's input
Activity
brson commentedon Feb 5, 2013
logshould be removed from the language.catamorphism commentedon Apr 25, 2013
Closing, because as I understand it, we're removing
log.bstrie commentedon Apr 26, 2013
Indeed, does not reproduce with
error!()in place oflog.Merge pull request rust-lang#4532 from rust-lang/rustup-2025-08-20
Merge rust-lang#4532