Skip to content

Confusing error when trying to call non-function #10969

Closed
@emberian

Description

@emberian
render/man.rs:62:28: 62:43 error: expected function but found `&'static str`
render/man.rs:62                     let s = shortty(&item);
                                             ^~~~~~~~~~~~~~~

It should say something like

error: cannot call non-callable `shortty`; expected function but found `T`
...
note: `shortty` declared here

The big thing is the pointer to the thing it thinks you're trying to call!

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions