Skip to content

Commit de6298c

Browse files
committed
---
yaml --- r: 16006 b: refs/heads/try c: 8678baa h: refs/heads/master v: v3
1 parent fccef31 commit de6298c

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 9f1a197c2a5c16f9703a35331eb53a8c070f66cf
5+
refs/heads/try: 8678baab12dcdac3286d882b2ab83b50ab451248
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rustc/middle/ty.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,9 @@ fn param_bounds_to_kind(bounds: param_bounds) -> kind {
427427
for vec::each(*bounds) {|bound|
428428
alt bound {
429429
bound_copy {
430-
kind = lower_kind(kind, kind_copyable());
430+
kind = raise_kind(kind, kind_copyable());
431431
}
432-
bound_send { kind = lower_kind(kind, kind_send_only()); }
432+
bound_send { kind = raise_kind(kind, kind_send_only()); }
433433
_ {}
434434
}
435435
}
@@ -1284,6 +1284,10 @@ fn kind_send_only() -> kind {
12841284
kind_(KIND_MASK_SEND)
12851285
}
12861286

1287+
fn kind_top() -> kind {
1288+
kind_(0xffffffffu32)
1289+
}
1290+
12871291
// Using these query functons is preferable to direct comparison or matching
12881292
// against the kind constants, as we may modify the kind hierarchy in the
12891293
// future.
@@ -1310,6 +1314,10 @@ fn kind_lteq(a: kind, b: kind) -> bool {
13101314
}
13111315

13121316
fn lower_kind(a: kind, b: kind) -> kind {
1317+
kind_(*a & *b)
1318+
}
1319+
1320+
fn raise_kind(a: kind, b: kind) -> kind {
13131321
kind_(*a | *b)
13141322
}
13151323

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// error-pattern: copying a noncopyable value
2+
3+
resource r(i: @mut int) {
4+
*i = *i + 1;
5+
}
6+
7+
fn main() {
8+
let i = @mut 0;
9+
{
10+
// Can't do this copy
11+
let x = ~~~{y: r(i)};
12+
let z = x;
13+
log(debug, x);
14+
}
15+
log(error, *i);
16+
}

0 commit comments

Comments
 (0)