Hi,

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_1.push(Bat_(bat));
                        objects_2.push(Bat_(bat));  // Line 124

rustc says:

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
banoid.rs:124                         objects_2.push(Bat_(bat));

It looks like the vector module only implements push(...) for "impl<T>
~[T]: MutableVector<T>".

I would appreciate if anyone could comment on this.
Thanks.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to