File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1526,7 +1526,10 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
1526
1526
}
1527
1527
lowest
1528
1528
}
1529
- ty_res( did, inner, tps) { kind_send_only( ) }
1529
+ ty_res( did, inner, tps) {
1530
+ let inner = subst( cx, tps, inner) ;
1531
+ ( kind_const( ) & type_kind( cx, inner) ) | kind_send_only( )
1532
+ }
1530
1533
ty_param( _, did) {
1531
1534
// FIXME: type params shouldn't be implicitly copyable (#2449)
1532
1535
let k = param_bounds_to_kind( cx. ty_param_bounds. get( did. node) ) ;
Original file line number Diff line number Diff line change 3
3
fn foo < T : const > ( _x : T ) { }
4
4
5
5
resource r( _x: int) { }
6
+ resource r2( _x: @mut int) { }
6
7
7
8
fn main ( ) {
8
9
foo ( { f: 3 } ) ;
@@ -13,7 +14,8 @@ fn main() {
13
14
foo ( ~mut 1 ) ; //! ERROR missing `const`
14
15
foo ( @1 ) ;
15
16
foo ( @mut 1 ) ; //! ERROR missing `const`
16
- foo ( r ( 1 ) ) ; //! ERROR missing `const`
17
+ foo ( r ( 1 ) ) ; // this is okay now.
18
+ foo ( r2 ( @mut 1 ) ) ; //! ERROR missing `const`
17
19
foo ( "123" ) ;
18
20
foo ( { f : { mut f: 1 } } ) ; //! ERROR missing `const`
19
21
}
You can’t perform that action at this time.
0 commit comments