about summary refs log tree commit diff
path: root/src/test/compile-fail/noncopyable-class.rs
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2013-02-07 19:33:12 -0800
committerNiko Matsakis <niko@alum.mit.edu>2013-02-08 07:20:39 -0800
commita380df809c8eb874540a123780612f14cfc7303e (patch)
tree236ebb1aced8876fd5e28bc999a3904e304de239 /src/test/compile-fail/noncopyable-class.rs
parent6647a3402bf75368de1a692370c558d423f36940 (diff)
downloadrust-a380df809c8eb874540a123780612f14cfc7303e.tar.gz
rust-a380df809c8eb874540a123780612f14cfc7303e.zip
Fix subtle error in caching during kind computation that could cause linear
values to be copied.  Rewrite kind computation so that instead of directly
computing the kind it computes what kinds of values are present in the type,
and then derive kinds based on that. I find this easier to think about.

Fixes #4821.
Diffstat (limited to 'src/test/compile-fail/noncopyable-class.rs')
-rw-r--r--src/test/compile-fail/noncopyable-class.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/test/compile-fail/noncopyable-class.rs b/src/test/compile-fail/noncopyable-class.rs
index 96a9347d2e9..360180ee455 100644
--- a/src/test/compile-fail/noncopyable-class.rs
+++ b/src/test/compile-fail/noncopyable-class.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// error-pattern: copying a noncopyable value
-
 // Test that a class with a non-copyable field can't be
 // copied
 struct bar {
@@ -38,4 +36,8 @@ fn foo(i:int) -> foo {
     }
 }
 
-fn main() { let x = move foo(10); let y = copy x; log(error, x); }
+fn main() {
+    let x = move foo(10);
+    let _y = copy x; //~ ERROR copying a value of non-copyable type
+    log(error, x);
+}