Skip to content

Commit 72e7f8c

Browse files
committed
---
yaml --- r: 13158 b: refs/heads/master c: 0470abe h: refs/heads/master v: v3
1 parent 61c7919 commit 72e7f8c

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
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: 3acc3c4d85e017edde2149eaabd44a78be5f7e17
2+
refs/heads/master: 0470abe1d290ef28fa72693b70f955328656e471
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/rustc/middle/ty.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,10 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
15261526
}
15271527
lowest
15281528
}
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+
}
15301533
ty_param(_, did) {
15311534
// FIXME: type params shouldn't be implicitly copyable (#2449)
15321535
let k = param_bounds_to_kind(cx.ty_param_bounds.get(did.node));

trunk/src/test/compile-fail/non-const.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
fn foo<T: const>(_x: T) { }
44

55
resource r(_x: int) {}
6+
resource r2(_x: @mut int) {}
67

78
fn main() {
89
foo({f: 3});
@@ -13,7 +14,8 @@ fn main() {
1314
foo(~mut 1); //! ERROR missing `const`
1415
foo(@1);
1516
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`
1719
foo("123");
1820
foo({f: {mut f: 1}}); //! ERROR missing `const`
1921
}

0 commit comments

Comments
 (0)