Skip to content

feat: backend-native-contracts #48

@mkovaxx

Description

@mkovaxx

Feature: Rustc Contracts Backend

Implement an anodized backend that targets the upstream nightly rustc-contracts experiment.

  • Expansion strategy:
    • requires clauses map 1:1 to #[core::contracts::requires(...)].
    • ensures clauses map 1:1 to #[core::contracts::ensures(...)].
    • maintains clauses emit both attributes so invariants remain enforced on entry and exit.
  • Unsupported today: captures have no equivalent in the nightly design, so the backend must fail with an error when encountering that.
  • Activation: exposed via a backend-native-contracts feature that only builds on nightly toolchains and switches code generation to emit the attributes of the nightly contracts experiment.
  • Testing: sample crate compiled with -Zcontract-checks to prove parity with the language-team experiment.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions