rust-lang / rust-lang/reference
Are function pointers never dangling?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 607
- PR merge metrics
- PR metrics pending
Description
https://doc.rust-lang.org/stable/reference/behavior-considered-undefined.html#r-undefined.dangling says:
A reference/pointer is “dangling” if not all of the bytes it points to are part of the same live allocation (so in particular they all have to be part of some allocation).
According to https://doc.rust-lang.org/reference/types.html#r-type.kinds
Pointer types:
- References
- Raw pointers
- Function pointers
The function pointers are categorized into pointer types. However, a function pointer is never dangling in a program. This should be clarified in section r-undefined.dangling.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Reference sections on undefined dangling pointers and pointer type kinds, and compare how function pointers fit their definitions. Clarify the dangling-pointer wording so its treatment of function pointers is unambiguous; the linked sections should reflect the resolved explanation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 62/100