Expand on cleanups in trans for expr_repeat and add to tests.

This commit is contained in:
Luqman Aden 2013-03-25 15:46:10 -07:00
parent 89a7407c99
commit e7f42f140b
2 changed files with 12 additions and 0 deletions

View file

@ -414,6 +414,11 @@ pub fn write_content(bcx: block,
return bcx;
}
// Some cleanup would be required in the case in which failure happens
// during a copy. But given that copy constructors are not overridable,
// this can only happen as a result of OOM. So we just skip out on the
// cleanup since things would *probably* be broken at that point anyways.
let elem = unpack_datum!(bcx, {
expr::trans_to_datum(bcx, element)
});

View file

@ -9,8 +9,15 @@
// except according to those terms.
pub fn main() {
struct Foo { a: ~str }
let v = [ ~Foo { a: ~"Hello!" }, ..129 ];
let w = [ ~"Hello!", ..129 ];
let x = [ @[true], ..512 ];
let y = [ 0, ..1 ];
error!("%?", v);
error!("%?", w);
error!("%?", x);
error!("%?", y);
}