diff --git a/src/comp/middle/kind.rs b/src/comp/middle/kind.rs index a06333df46ca..5460bb3cf2f2 100644 --- a/src/comp/middle/kind.rs +++ b/src/comp/middle/kind.rs @@ -177,6 +177,7 @@ fn check_expr(tcx: ty::ctxt, e: @ast::expr) { ast::expr_swap(a, b) { need_shared_lhs_rhs(tcx, a, b, "<->"); } ast::expr_copy(a) { need_expr_kind(tcx, a, ast::kind_shared, "'copy' operand"); + check_copy(tcx, a); } ast::expr_ret(option::some(a)) { need_expr_kind(tcx, a, ast::kind_shared, "'ret' operand"); diff --git a/src/test/compile-fail/vec-pinned-nocopy-3.rs b/src/test/compile-fail/vec-pinned-nocopy-3.rs new file mode 100644 index 000000000000..06e2c33b3216 --- /dev/null +++ b/src/test/compile-fail/vec-pinned-nocopy-3.rs @@ -0,0 +1,10 @@ +// error-pattern: mismatched kind + +resource r(b: bool) { +} + +fn main() { + let i = [r(true)]; + let j; + j <- copy [r(true)]; +} \ No newline at end of file