remove dead assignments

This commit is contained in:
Niko Matsakis 2012-05-24 13:35:57 -07:00
parent f5c51b0a9c
commit ccd8d5573e
16 changed files with 24 additions and 51 deletions

View file

@ -18,6 +18,8 @@ fn test2() {
pure_borrow(x, x = ~5); //! ERROR assigning to mutable local variable prohibited due to outstanding loan
//!^ NOTE loan of mutable local variable granted here
copy x;
}
fn main() {

Binary file not shown.

View file

@ -1,4 +1,3 @@
// error-pattern: unsatisfied precondition constraint
use std;
import std::arc;
import comm::*;
@ -6,13 +5,13 @@ import comm::*;
fn main() {
let v = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let arc_v = arc::arc(v);
task::spawn() {|move arc_v|
task::spawn() {|move arc_v| //! NOTE move of variable occurred here
let v = *arc::get(&arc_v);
assert v[3] == 4;
};
assert (*arc::get(&arc_v))[2] == 3;
assert (*arc::get(&arc_v))[2] == 3; //! ERROR use of moved variable: `arc_v`
log(info, arc_v);
}