Skip to content

"If not, try an anonymous function" is too vague to be helpful #32658

Closed

Description

I just got this error message:

../src/test/compile-fail/assign-to-method.rs:30:8: 30:13 error: attempted to take value of method `speak` on type `cat`
../src/test/compile-fail/assign-to-method.rs:30   nyan.speak = || println!("meow"); //~ ERROR attempted to take value of method
                                                       ^~~~~
../src/test/compile-fail/assign-to-method.rs:30:8: 30:13 help: maybe a `()` to call it is missing? If not, try an anonymous function

I don't know what "if not, try an anonymous function" means. What about an anonymous function am I supposed to try? Can we remove this help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions