Skip to content

Find your first stale reference

LucaCappelletti94 edited this page Oct 22, 2026 · 1 revision

This tutorial leaves a Markdown reference behind when a function is renamed, then repairs it.

Install cargo refquiem using Home. Run these commands in a directory outside an existing Cargo workspace. Git must have an author name and email configured.

Create a documented function

cargo new --lib --vcs git refquiem_demo
cd refquiem_demo
printf 'pub fn render_v1() {}\n' > src/lib.rs
printf 'Call `refquiem_demo::render_v1` to render a page.\n' > README.md
git add Cargo.toml src/lib.rs README.md .gitignore
git commit -m 'Add renderer'

Rename the function

Leave the reference in README.md unchanged.

printf 'pub fn render_v2() {}\n' > src/lib.rs
git add src/lib.rs
git commit -m 'Rename renderer'
cargo refquiem

The output is similar to the following. The deletion commit identifier depends on the local commits.

refquiem: 1 removed name still mentioned, 1 mention

`refquiem_demo::render_v1` (function), deleted in f3e6824, renamed to `refquiem_demo::render_v2`
  README.md:1:7  Markdown code span

The command exits with status 1. The location identifies the stale mention, and the suggested name matches the function just introduced.

Repair the reference

printf 'Call `refquiem_demo::render_v2` to render a page.\n' > README.md
cargo refquiem

The output is similar to the following.

refquiem: no stale mentions

The command exits with status 0. The correction is still uncommitted and is included because the default comparison uses the working tree.

Compare committed revisions

cargo refquiem --base HEAD^ --head HEAD

This reports the stale reference again. --head HEAD reads the committed README.md, which still names render_v1, without changing the working tree.

For a branch review, choose its base and head explicitly. See History and cache for the range semantics and Reports for machine-readable findings.

Clone this wiki locally