rust-lang / rust-lang/reference

Type coercion from function item types to function pointers

Open
#1,525 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-coercions
Dominant language
Rust
Stars
1.6k
Forks
607
PR merge metrics
PR metrics pending

Description

The "Type coercions" section says coercion is allowed from:

  • Function item types to fn pointers
  • Non capturing closures to fn pointers

This ought to describe the compatibility requirements, including:

  • the signatures must be compatible (which needs defining)
  • the ABI must be the same
  • the safety must be the same

See ferrocene/specification#460 and ferrocene/specification#472

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the “Type coercions” section in the Rust Reference and read ferrocene/specification#460 and ferrocene/specification#472. Determine and document compatible signatures, ABI, and safety requirements for function item types and non-capturing closures coercing to function pointers; done means the compatibility rules are clearly specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.