rust/tests/ui/methods/assign-to-method.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
631 B
Plaintext
Raw Normal View History

error[E0615]: attempted to take value of method `speak` on type `Cat`
2020-02-24 09:21:45 -06:00
--> $DIR/assign-to-method.rs:22:10
2018-08-08 07:28:26 -05:00
|
2020-02-24 09:21:45 -06:00
LL | nyan.speak = || println!("meow");
2020-03-22 13:18:06 -05:00
| ^^^^^ method, not a field
2018-08-08 07:28:26 -05:00
|
= help: methods are immutable and cannot be assigned to
2018-08-08 07:28:26 -05:00
error[E0615]: attempted to take value of method `speak` on type `Cat`
2020-02-24 09:21:45 -06:00
--> $DIR/assign-to-method.rs:23:10
|
2020-02-24 09:21:45 -06:00
LL | nyan.speak += || println!("meow");
2020-03-22 13:18:06 -05:00
| ^^^^^ method, not a field
|
= help: methods are immutable and cannot be assigned to
error: aborting due to 2 previous errors
2018-08-08 07:28:26 -05:00
For more information about this error, try `rustc --explain E0615`.