rust/src/test/ui/assignment-operator-unimplemented.rs

8 lines
152 B
Rust
Raw Normal View History

struct Foo;
fn main() {
let mut a = Foo;
let ref b = Foo;
2015-09-10 19:16:57 -05:00
a += *b; //~ Error: binary assignment operation `+=` cannot be applied to type `Foo`
}