rust-lang / rust-lang/rust

rustc_contracts: differentiate between exhaustive and non-exhaustive contracts

Open
#128,274 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-docs C-discussion F-contracts T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Tracking Issue: https://github.com/rust-lang/rust/issues/128044

exhaustive: the contract fully encodes all requirements for using the function safely.

non-exhaustive: there are some additional safety pre-conditions or post-conditions that are not described by the contract, ie. it is possible to cause UB while fufilling the contract's requirements.

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 the linked tracking issue, rust-lang/rust#128044, for the existing rustc_contracts design and implementation context. Clarify how exhaustive and non-exhaustive contracts should be represented and checked, then confirm that the resulting behavior distinguishes fully encoded safety requirements from contracts with additional unstated preconditions or postconditions.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
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.