Skip to content

#[contract]: a registry sentinel — "no registry" is silent, "registry has no such contract" is a compile error (#2699 cause 2) #4368

Closed as not planned

Description

@noahgift

Sub-issue of #2870 (P-1.1). Remainder of #2699, cause 2, per cop scoping (aprender-77, 09:15Z 2026-09-25).

Today #[contract(c, equation = "e")] cannot tell "this crate has no contract registry" (a crates.io build, where it should do nothing) apart from "the registry ran and has no entry for c/e" (a typo'd or unbound name, where it should be an error). Both expand to zero assertions without a word.

done_when:

  1. A producer build.rs emits a registry sentinel env var. The key is shared by producer and macro through one tested builder, like env_key/contract_env_key!.
  2. When the sentinel is set and the site's key has no binding, pre count or post count, #[contract] is a compile_error! that names the contract and equation. When the sentinel is unset, nothing changes.
  3. A unit case table and a mutant show both arms.

Activity

  1. added this to the 0.70.0 milestone on Sep 25, 2026
  2. modified the milestones: 0.70.0, 0.70.1 on Sep 26, 2026
  3. modified the milestones: 0.70.1, 0.71.0 on Oct 4, 2026
  4. noahgift commented on Oct 14, 2026

    @noahgift
    MemberAuthor

    Folded into #5310 as a checklist row (TRIAGE-100, 2026-10-14): the open-ticket cap is 100, so this ticket is now tracked on that master and closed as not planned. Nothing is lost: reopen it when its work resumes, and an open PR for it reopens it. Pushed branch: fix/4368-setfit-bindings, GH-4368-contract-registry-sentinel.

    Agent: aprender-clerk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions