Skip to content
CAI
Software that uses CAICheck a score

dtolnay/proc-macro-workshop

66.1

Adequate · 14 November 2026

54

lines of production code

Rust

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Rust workspace designed as an educational workshop for procedural macros, providing both instructional materials and a set of macro implementations. It includes a fully functional bitfield macro for generating bit-packed struct accessors, alongside skeleton implementations for builder, debug, sequence, and sorted macros that serve as structural foundations for learning. The project utilizes trybuild for comprehensive compile-time and UI testing to validate macro behavior and error handling.

Features

Add CustomDebug derive macro skeleton

The debug library now includes a new proc-macro derive named CustomDebug. Currently, this macro is a placeholder that does not implement any functionality, serving as a structural foundation for future debug-related features.

debug/src · high confidence

Add experimental \#\[sorted\] procedural macro attribute

A new \\#\[sorted\]\ procedural macro attribute has been added to the library. Currently, it is a stub that does not perform any sorting logic and will panic if invoked, serving as a placeholder for future implementation.

sorted/src · high confidence

Added initial seq proc-macro skeleton

A new \seq\ proc-macro has been added to the library, providing a \\#\[seq\]\ attribute entry point. Currently, the macro is a placeholder that does not implement any functionality, serving as a structural foundation for future development.

seq/src · high confidence

Initial bitfield macro skeleton and test suite

The \bitfield\ crate is introduced with a procedural macro that generates getters and setters for struct fields, allowing users to define compact, bit-packed data structures. The initial implementation supports basic integer fields (B1–B64), enforces that total field sizes are multiples of 8 bits, and provides accessor methods with signatures matching the narrowest unsigned integer types. It also supports enum fields with power-of-two variants and allows optional \\#\[bits = N\]\ attributes for explicit size documentation. A comprehensive test suite validates these behaviors, including edge cases like fields spanning byte boundaries and compile-time checks for invalid discriminants or sizes.

bitfield · high confidence

Initial builder derive macro skeleton

The builder module now includes a new \lib.rs\ file that defines a \\#\[proc\_macro\_derive(Builder)\]\ macro. Currently, this macro is a placeholder that does not implement any functionality, serving as the structural foundation for future builder pattern generation.

builder/src · high confidence

Initial project setup with workshop materials and licensing

This change establishes the repository structure for a Rust procedural macros workshop. It adds the Apache-2.0 and MIT license files, a .gitignore configuration for Rust build artifacts, and a main.rs entry point. The README.md introduces five specific learning projects: derive macros for Builder and CustomDebug, a function-like seq! macro, and attribute macros for sorted and bitfield, along with debugging tips and workflow instructions for participants.

(repo-wide) · high confidence

Initial project template structure with trybuild integration

The .template directory now provides a foundational project layout for new projects, including a lib.rs entry point and a test suite configured with trybuild for compile-time testing. The template includes a placeholder test file (tests/progress.rs) that initializes trybuild but currently contains no active tests, and the extern crate declarations have been removed from the template source to align with modern Rust conventions.

.template · high confidence

Initial skeleton for the \`\#\[bitfield\]\` procedural macro

The \bitfield/impl\ crate has been added as the implementation backend for the \\#\[bitfield\]\ attribute. Currently, it provides a procedural macro stub that accepts arguments and input but returns \unimplemented!()\, serving as the structural foundation for future bitfield generation logic.

bitfield/impl · high confidence

Test coverage

Added UI test suite for the \#\[sorted\] procedural macro; Added builder tutorial tests; Added initial test suite for the seq procedural macro; Added test suite for CustomDebug derive macro implementation.

Dependencies

Initialize Rust workspace with proc-macro crates and trybuild testing

The project is structured as a Rust workspace containing several proc-macro crates (bitfield, derive\_builder, derive\_debug, seq, sorted) and a workshop binary, all targeting the 2021 edition. Each crate includes dev-dependencies on trybuild version 1.0.108 with the 'diff' feature enabled to support UI testing with stderr mismatch diffs.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 67 → 66 (-1.1)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 100 → 99 (-0.1)
  • Architecture 100 → 100 (+0.0)
  • Maturity 88 → 88 (+0.0)
  • Readiness 37 → 35 (-2.2)
  • Security 100 → 100 (+0.0)

New (6)

  • Low coverage: bitfield/impl/src/lib.rs (bitfield/impl/src/lib.rs)
  • Low coverage: builder/src/lib.rs (builder/src/lib.rs)
  • Low coverage: debug/src/lib.rs (debug/src/lib.rs)
  • Low coverage: main.rs (main.rs)
  • Low coverage: seq/src/lib.rs (seq/src/lib.rs)
  • Low coverage: sorted/src/lib.rs (sorted/src/lib.rs)

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

dtolnay/proc-macro-workshop was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 7555faf30a350fb0360c75dba2d77c50ec9b705d — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-e1a3b69fc8ee.