File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: 9f1a197c2a5c16f9703a35331eb53a8c070f66cf
5
+ refs/heads/try: 8678baab12dcdac3286d882b2ab83b50ab451248
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change @@ -427,9 +427,9 @@ fn param_bounds_to_kind(bounds: param_bounds) -> kind {
427
427
for vec:: each( * bounds) { |bound|
428
428
alt bound {
429
429
bound_copy {
430
- kind = lower_kind ( kind, kind_copyable( ) ) ;
430
+ kind = raise_kind ( kind, kind_copyable( ) ) ;
431
431
}
432
- bound_send { kind = lower_kind ( kind, kind_send_only( ) ) ; }
432
+ bound_send { kind = raise_kind ( kind, kind_send_only( ) ) ; }
433
433
_ { }
434
434
}
435
435
}
@@ -1284,6 +1284,10 @@ fn kind_send_only() -> kind {
1284
1284
kind_( KIND_MASK_SEND )
1285
1285
}
1286
1286
1287
+ fn kind_top( ) -> kind {
1288
+ kind_( 0xffffffffu32 )
1289
+ }
1290
+
1287
1291
// Using these query functons is preferable to direct comparison or matching
1288
1292
// against the kind constants, as we may modify the kind hierarchy in the
1289
1293
// future.
@@ -1310,6 +1314,10 @@ fn kind_lteq(a: kind, b: kind) -> bool {
1310
1314
}
1311
1315
1312
1316
fn lower_kind( a: kind, b: kind) -> kind {
1317
+ kind_( * a & * b)
1318
+ }
1319
+
1320
+ fn raise_kind( a: kind, b: kind) -> kind {
1313
1321
kind_( * a | * b)
1314
1322
}
1315
1323
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments