Skip to content

Commit 7e42c51

Browse files
committed
---
yaml --- r: 13005 b: refs/heads/master c: 5f15477 h: refs/heads/master i: 13003: 630806c v: v3
1 parent 4c1457d commit 7e42c51

File tree

6 files changed

+46
-6
lines changed

6 files changed

+46
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 6fa1a084f7714023c4594ec7a857359824dc3253
2+
refs/heads/master: 5f154770e2e921e717127b9fe95e09856305fd6f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/rustc/middle/kind.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ fn with_appropriate_checker(cx: ctx, id: node_id, b: fn(check_fn)) {
7171
// moved in or copied in
7272
check_send(cx, var_t, sp);
7373

74+
// copied in data must be copyable, but moved in data can be anything
75+
if !is_move { check_copy(cx, var_t, sp); }
76+
7477
// check that only immutable variables are implicitly copied in
7578
if !is_move {
7679
for fv.each { |fv|

trunk/src/rustdoc/fold.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ fn default_seq_fold_item<T>(
171171
doc
172172
}
173173

174-
fn default_any_fold_mod<T:send>(
174+
fn default_any_fold_mod<T:send copy>(
175175
fold: fold<T>,
176176
doc: doc::moddoc
177177
) -> doc::moddoc {
@@ -197,7 +197,7 @@ fn default_seq_fold_mod<T>(
197197
}
198198
}
199199

200-
fn default_par_fold_mod<T:send>(
200+
fn default_par_fold_mod<T:send copy>(
201201
fold: fold<T>,
202202
doc: doc::moddoc
203203
) -> doc::moddoc {
@@ -210,7 +210,7 @@ fn default_par_fold_mod<T:send>(
210210
}
211211
}
212212

213-
fn default_any_fold_nmod<T:send>(
213+
fn default_any_fold_nmod<T:send copy>(
214214
fold: fold<T>,
215215
doc: doc::nmoddoc
216216
) -> doc::nmoddoc {
@@ -236,7 +236,7 @@ fn default_seq_fold_nmod<T>(
236236
}
237237
}
238238

239-
fn default_par_fold_nmod<T:send>(
239+
fn default_par_fold_nmod<T:send copy>(
240240
fold: fold<T>,
241241
doc: doc::nmoddoc
242242
) -> doc::nmoddoc {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// error-pattern: copying a noncopyable value
2+
3+
use std;
4+
import std::arc;
5+
import comm::*;
6+
7+
fn main() {
8+
let v = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
9+
let arc_v = arc::arc(v);
10+
11+
task::spawn() {||
12+
let v = *arc::get(&arc_v);
13+
assert v[3] == 4;
14+
};
15+
16+
assert (*arc::get(&arc_v))[2] == 3;
17+
18+
log(info, arc_v);
19+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// error-pattern: unsatisfied precondition constraint
2+
use std;
3+
import std::arc;
4+
import comm::*;
5+
6+
fn main() {
7+
let v = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
8+
let arc_v = arc::arc(v);
9+
10+
task::spawn() {|move arc_v|
11+
let v = *arc::get(&arc_v);
12+
assert v[3] == 4;
13+
};
14+
15+
assert (*arc::get(&arc_v))[2] == 3;
16+
17+
log(info, arc_v);
18+
}

trunk/src/test/run-pass/uniq-cc-generic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type pointy = {
88
d : fn~() -> uint,
99
};
1010

11-
fn make_uniq_closure<A:send>(a: A) -> fn~() -> uint {
11+
fn make_uniq_closure<A:send copy>(a: A) -> fn~() -> uint {
1212
fn~() -> uint { ptr::addr_of(a) as uint }
1313
}
1414

0 commit comments

Comments
 (0)