e3fe0ee97b
Furthermore, don't suggest calling the method if it is part of a place expression, as this is invalid syntax.
20 lines
669 B
Plaintext
20 lines
669 B
Plaintext
error[E0615]: attempted to take value of method `speak` on type `Cat`
|
|
--> $DIR/assign-to-method.rs:20:8
|
|
|
|
|
LL | nyan.speak = || println!("meow"); //~ ERROR attempted to take value of method
|
|
| ^^^^^
|
|
|
|
|
= help: methods are immutable and cannot be assigned to
|
|
|
|
error[E0615]: attempted to take value of method `speak` on type `Cat`
|
|
--> $DIR/assign-to-method.rs:21:8
|
|
|
|
|
LL | nyan.speak += || println!("meow"); //~ ERROR attempted to take value of method
|
|
| ^^^^^
|
|
|
|
|
= help: methods are immutable and cannot be assigned to
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0615`.
|