Decaf Rust examples
Find a file
2026-01-05 11:37:38 +05:30
.cargo Minigrep 2026-01-05 11:37:38 +05:30
compat Minigrep 2026-01-05 11:37:38 +05:30
examples/minigrep Minigrep 2026-01-05 11:37:38 +05:30
.gitignore Minigrep 2026-01-05 11:37:38 +05:30
.nvim.lua Minigrep 2026-01-05 11:37:38 +05:30
Cargo.lock Minigrep 2026-01-05 11:37:38 +05:30
Cargo.toml Minigrep 2026-01-05 11:37:38 +05:30
README.md Minigrep 2026-01-05 11:37:38 +05:30

Example programs for decaf-rust

Examples are in the examples/ folder.

  1. They are setup to use the custom no mutable references compiler using a workspace level .cargo/config.toml file.
  2. In each individual example, there is a build.rs file that injects an env var only when compiling the sources for the current crate. This env var turns on no_mut_refs in our custom compiler. This way, it's possible to import dependencies without failing.

IDE support

  1. LazyVim: A workspace level .nvim.lua file is added which sets up the custom no mutable references compiler for IDE errors and suggestions.