rust-lang / rust-lang/rust-bindgen

Add extra documentations to bindgen helper functinos

Open
#3,356 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
5.3k
Forks
829
Avg merge
1d 1h
Merged PRs (30d)
15

Description

Related to #2758 but for certain helper functions that are separately created by bindgen, for example with functions like this for dynamic loading.

Seems to be even if we add # Safety documentations to all of the individual functions from bindgen, we still run up against the issue where the fn new and fn from_library functions are unsafe but have no way to add # Safety documentations since it is entirely just generated by bindgen itself.

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 helper generation example in bindgen/codegen/dyngen.rs, especially the generated new and from_library functions. Check how documentation is emitted for these unsafe helpers and verify that the generated output includes suitable # Safety documentation for them.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.