remove dead assignments
This commit is contained in:
parent
f5c51b0a9c
commit
ccd8d5573e
16 changed files with 24 additions and 51 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
BIN
src/test/compile-fail/liveness-unused
Executable file
BIN
src/test/compile-fail/liveness-unused
Executable file
Binary file not shown.
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue