rust-bitcoin / rust-bitcoin/rust-bitcoin

`const fn`

Open
#1,174 15 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement minor API Change
Dominant language
Rust
Stars
2.7k
Forks
1k
Avg merge
4d 39m
Merged PRs (30d)
86

Description

After MSRV bump we can start making functions const. I think we have many of them that can and should be const (like the newly added newtypes). I forgot about this when discussing MSRV bump but I don't mind since this is probably large anyway. We can't just mindlessly add them wherever compiler doesn't complain, we have to answer this question for each fn: "can we guarantee that this function will never call into OS or mutate global state?"

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

No files, tests, or entry points are named. Start by reviewing the MSRV bump context and inventorying candidate functions, including the newly added newtypes; for each one, determine whether it can be guaranteed never to call into the OS or mutate global state, and consider the work done only when the selected functions are safely const.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.