rust-lang / rust-lang/cargo

Migrate to annotate-snippets

Open
#15,944 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-console-output A-diagnostics C-tracking-issue
Dominant language
Rust
Stars
15.5k
Forks
3k
Avg merge
23h 30m
Merged PRs (30d)
51

Description

annotate-snippets is a library version of rustc's diagnostic report renderer.

By migrating cargo to use it,

  • we make them more consistent
  • we have more features (coloring trailing notes/help, snippet rendering, etc)
  • prepare for moving some of our diagnostics to be lints

Tasks

  • #15928
  • Clean up multi-line Shell::notes
    • #15942
    • #15943
  • Migrate Shell::note to use print_report (#15945)
  • Clean up multi-line or multi-part Shell::warns (excluding util/toml/mod.rs warnings)
    • #16035
  • Somehow handle util/toml/mod.rs warnings, either create a custom diagnostic type or move the warnings to a lint phase
  • Migrate Shell::warn to use print_report (#15917)
  • Switch anyhow::Error to a custom error type
  • Cleanup multi-line errors
  • Migrate error rendering (src/cargo/lib.rs) to print_report (#15922)

Notes:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the remaining checklist items for Shell::warn, util/toml/mod.rs warnings, anyhow::Error, and error rendering in src/cargo/lib.rs. Read the Rust diagnostics style guide and existing print_report migrations first. Done means the remaining diagnostic paths are migrated consistently, with the listed warning and error cases handled.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.