Skip to main content
When you want feedback from the compiler without waiting for a full native-code build, sifr check is the right tool. It runs the parser and type-checker and reports all diagnostics, but stops before code generation or linking. When you want to see exactly what Rust code Sifr produces for a given source file, sifr emit prints it to stdout.

sifr check — type-check without compiling

sifr check runs the compiler frontend — parsing, name resolution, and type-checking — and exits. No binary is produced and no linking happens, which makes it the fastest way to verify that your code is correct.
Run a check on a whole package or workspace:

Flags

Using check in your workflow

sifr check is designed for tight edit-check loops. Run it on save, in a watch loop, or as the first step in CI before invoking sifr build.
Use sifr check as your primary feedback loop during development and reserve sifr build for when you need an artifact. Check is substantially faster because it skips code generation and linking.

Inspecting saved-source reuse

Installed commands use the metadata shipped with the selected compiler. A matching saved-source result can restore completed diagnostics in a new process. Changed inputs, corrupt optional records and unsupported external contexts recompute through the ordinary checker.
Timing output goes to stderr. It reports total command time, computed/restored diagnostic counts, source validation and publication costs, plus metadata read/hash/index costs and decoded record counts. Metadata load timings describe this process’s immutable owner; they are not a separate interval to subtract from total command time. Comparing tracing-enabled and disabled runs measures the reporting overhead. --no-incremental bypasses project-result reads and writes. It preserves installed metadata and Cargo’s native caches. A missing or incompatible installed metadata artifact requires repairing the installation; it does not trigger source bootstrap. doctor --verify-integrity performs the more expensive complete package check explicitly. For offline package work, prepare dependencies with sifr fetch while network access is available, then use sifr check --frozen. Cache reuse does not waive lockfile, configuration, trust or dependency checks.

sifr emit — inspect the generated Rust code

sifr emit runs the compiler up through code generation and prints the generated Rust source to stdout. No binary is written. This is useful when you want to understand how Sifr translates a particular construct, diagnose unexpected output, or satisfy your curiosity.
Pipe the output to a pager or capture it to a file:

Example

Given this Sifr source:
Running sifr emit hello.sifr prints the corresponding Rust code that the compiler produced before handing off to the Rust toolchain.
The output of sifr emit reflects the compiler’s internal representation and is not intended to be a stable public API. Its exact form may change between compiler versions as the code generator evolves.

Diagnostic output formats

Both sifr check and sifr emit respect the global --diagnostic-format flag. Pass it before the subcommand name.
Source snippets, caret highlights, notes, help text, and documentation URLs. Best for interactive use.

Explaining a diagnostic code

When you see a diagnostic code such as SIFR-TYPE-0002, pass it to --explain to get a human-readable description without re-running the compiler:
Request JSON output for programmatic consumption:
--explain works for any diagnostic code the compiler knows about and exits with code 0 on success or 2 if the code is unknown. A normal explicit-file check in a virtual Cargo workspace can check a standalone source file without resolving unrelated Cargo members. This applies only when the enclosing source workspace has no backend/dependency authority and the file has no nested Cargo package. A nested source-only manifest must have a valid source root that owns the checked file. It intentionally removes failures from unrelated broken members in that case. Actual package checks and explicit --locked, --offline and --frozen checks retain Cargo validation. Standalone frontend checks do not probe Cargo or rustc for an unused native build plan. Native builds and actual package checks retain their required toolchain, dependency, trust and backend validation.