Don't allow vectors of pinned kinds to be copied

This commit is contained in:
Brian Anderson 2011-09-26 19:56:38 -07:00
parent 4bee452221
commit 99cbea51a1
2 changed files with 14 additions and 0 deletions

View File

@ -150,6 +150,10 @@ fn check_copy(tcx: ty::ctxt, e: @ast::expr) {
demand_kind(tcx, e.span, mt.ty, ast::kind_shared,
"unique box interior");
}
ty::ty_vec(mt) {
demand_kind(tcx, e.span, mt.ty, ast::kind_shared,
"vector interior");
}
_ { }
}
}

View File

@ -0,0 +1,10 @@
// error-pattern: mismatched kind
resource r(b: bool) {
}
fn main() {
let i = [r(true)];
let j;
j = i;
}