rust-lang / rust-lang/reference

Document the rules for const UB

Open Beginner friendly
#2,294 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-const-eval A-undefined-behavior
Dominant language
Rust
Stars
1.6k
Forks
607
PR merge metrics
PR metrics pending

Description

In https://github.com/rust-lang/rfcs/blob/master/text/3016-const-ub.md we decided on the rules for const UB. In particular, a compile error is not guaranteed when a const has UB. I think this is currently not (yet) reflected anywhere in the Reference.

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 by reading text/3016-const-ub.md in the Rust RFC repository, then search the Rust Reference for existing const-evaluation or undefined-behavior rules. Document that RFC 3016's rules apply, including that a const with UB does not necessarily produce a compile error; done means the Reference clearly reflects these rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.