rust/src/test/ui/assign-to-method.stderr
Andy Russell e3fe0ee97b
use structured suggestion for method calls
Furthermore, don't suggest calling the method if it is part of a place
expression, as this is invalid syntax.
2019-01-03 13:42:52 -05:00

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`.