Skip to content

Confusing compiler error when dealing with references to a function pointer #51233

@HenryNguyen5

Description

@HenryNguyen5

When using a reference to a function pointer, it gets converted to a reference to a function item instead, making future assignments require a typecast to the wanted function pointer instead.

Relevant link below:
https://play.rust-lang.org/?gist=00a013ae03ba8b50ceb37499985807f1&version=nightly&mode=debug

Metadata

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