rust-lang / rust-lang/rust

Extend the json compiler output to produce simulatneously the short and long type output without writing to disk

Open
#150,234 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-diagnostics C-feature-request D-diagnostic-infra T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

rustc currently will trim long type names by default, and write the full path that got elided to a file on disk (generally on the target directory). This rarely causes any trouble and manages to keep terminal output legible even in the face of terribly long types. But there are cases where people get alarmed by the existence of these files (like recently at https://www.reddit.com/r/rust/comments/1ps82dl/media_what_is_this_longtypetxt_thing/), and I suppose these people might be interacting with rustc through VSCode and rust-analyzer, hence rarely seeing the full diagnostic output. If the json output had both the short and long output without ever printing the file to disk, interactive tools like rust-analyzer can show the shorter output by default with a button to expand each diagnostic, without ever polluting the user's drive, at the cost of the occasional duplicated diagnostic information in the json output.

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 by tracing rustc's JSON diagnostic generation and the existing handling of trimmed long type names and long-type files. Determine how both short and full output could be represented without writing the full path to disk, then verify that interactive consumers can select the shorter or expanded diagnostic output.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.