[Solved] Error: overloaded augmented assignments are not stable


#1

EDIT: Well, it seems that the problem was that linux mint doesn’t supply the newest version of rust. I upgraded and now it compiles. Which is weird since from what I read, overloaded assignments are still not stable, but what do I know.

I tried compiling nalgebra directly, and it still gives me the error.

Here is an excerpt:

src/structs/matrix_macros.rs:404:9: 404:48 note: in this expansion of pointwise_scalar_mul! (defined in src/structs/common_macros.rs)
src/structs/matrix.rs:249:1: 256:3 note: in this expansion of matrix_impl! (defined in src/structs/matrix_macros.rs)
src/structs/common_macros.rs:261:20: 261:40 help: add #![feature(augmented_assignments)] to the crate root to enable
src/structs/common_macros.rs:261:20: 261:40 error: overloaded augmented assignments are not stable
src/structs/common_macros.rs:261                 $( self.$compN *= right; )+
                                                    ^~~~~~~~~~~~~~~~~~~~

There are around 900 of these errors.

(EDIT: This is not true. Whoops . The compiler still complained about not having {OP} implemented though. This is annoying to fix, since in all these places only the {OP}Assign trait is defined, and not the actual {OP} trait.)
The compiler’s advice is not very useful either, since adding #![feature(augmented_assignments)] causes error: #[feature] may not be used on the stable release channel

As far as I could tell, there are no plans to stabilize the {OP}Assign traits, so I don’t really know an ergonomic way to fix this.

I’m not super sure if it matters, but I’m using rust 1.7.0 on linux mint.

EDIT: After some looking around, I can see that the {OP}Assign trait implementations were added on version 0.7.0