We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c587745 commit e804352Copy full SHA for e804352
src/test/run-pass/unique-swap2.rs renamed to src/test/compile-fail/unique-swap2.rs
@@ -1,8 +1,4 @@
1
-// xfail-test
2
-
3
-// This no longer works because ~r() is lowered to a pinned type
4
-// (which can't be swapped). Should probably be a compile-fail
5
-// test.
+// error-pattern: mismatched kinds
6
7
resource r(i: @mutable int) {
8
*i += 1;
@@ -14,6 +10,8 @@ fn test1() {
14
10
{
15
11
let x = ~r(i);
16
12
let y = ~r(j);
13
+ // Unique boxes containing resources are lowered to pinned kinds,
+ // which can't be swapped
17
x <-> y;
18
assert ***x == 200;
19
assert ***y == 100;
0 commit comments