rust-lang / rust-lang/reference

CTFE Undefined Behavior

Open
#1,077 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

Some undefined behavior found during CTFE is now treated as an error as of https://github.com/rust-lang/rust/pull/86194. I think https://github.com/rust-lang/reference/blob/master/src/const_eval.md should detail which errors are detected, but Ralf indicated in https://github.com/rust-lang/rust/pull/86194#issuecomment-864803029 that they don't want to make any guarantees about which UB is detected. I can understand that, but it also leaves the language a little under specified. I'm not sure how to resolve that.

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 src/const_eval.md, Rust PR #86194, and Ralf's linked comment to understand the existing behavior and the concern about guarantees. The issue does not define a resolution; progress would require deciding whether the Reference should document detected CTFE errors or explicitly describe the behavior as unspecified.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
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.