rust-lang / rust-lang/rust-analyzer

The output of the program is treated as a Rustc diagnostic message

Open
#13,211 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-vscode C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 13h
Merged PRs (30d)
69

Description

rust-analyzer version: 0.3.1194-standalone (67920f797 2022-09-04)

rustc version: rustc 1.61.0 (fe5b13d68 2022-05-18)

It seems that RA can't distinguish well between the output of Rust compiler and the output of the program. When I print a string similar to the Rust diagnostic message, VS Code reports it as a Rust error.

I found this problem because I was writing a diagnostic engine similar to Rustc's, and these red lines kept appearing in my test files.

example

To reproduce this issue in VSCode, you need to use the run button on the main function.

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

Reproduce the issue in VS Code using the Run button on a main function, printing text that resembles a Rust diagnostic. Start by tracing how rust-analyzer distinguishes compiler diagnostics from program output; done means diagnostic-like program output is not reported as a Rust error while actual compiler diagnostics still are.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.