Skip to content

Add # Examples sections to cssl-effects public API #4

@Apocky

Description

@Apocky

Summary

The cssl-effects crate defines the 28+ built-in effect types and the EffectRow / EffectSet types that appear in every function signature in Sigil. The public API has good summary doc comments but no # Examples sections.

Rustdoc examples serve as the canonical usage guide for contributors learning how to construct effect rows programmatically (e.g., in passes that analyze or transform effect annotations).

What to do

For the main public types in cssl-effects/src/lib.rs (and sub-modules), add # Examples blocks showing:

  1. Constructing an EffectRow with a few effects
  2. Checking if a row contains a specific effect (e.g., NoAlloc)
  3. Merging / unifying two effect rows
  4. The Deadline<N> parameterized effect with a concrete N

Ensure examples compile by running cargo test --doc -p cssl-effects.

Why this is a good first issue

  • No type system or IR changes required
  • Forces you to understand the effect system — the most distinctive feature of Sigil
  • Examples become part of the test suite (doctests)
  • Directly helps the next contributor who needs to write a pass that touches effects

Files

  • compiler-rs/crates/cssl-effects/src/ (all pub items)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions