[rust-dev] problems with adding an element to a ' @' vector.
peter.ronnquist at gmail.com
Mon Dec 10 14:34:52 PST 2012
I am having problems with adding an element to a '@' vector in rust 0.4.
The following works fine with a "~" vector but not with a '@' vector:
let mut objects_1 : &mut ~[Object] = &mut ~;
let mut objects_2 : &mut @[Object] = &mut @;
objects_2.push(Bat_(bat)); // Line 124
banoid.rs:124:24: 124:38 error: attempted access of field `push` on type
`&mut @[Object]`, but no field or method with that name was found
It looks like the vector module only implements push(...) for "impl<T>
I would appreciate if anyone could comment on this.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rust-dev