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