Skip to content

Add an easier way of running rustc --explain #13888

Closed as not planned
Closed as not planned
@oriongonza

Description

@oriongonza

Problem

fn main() {
    hello
}

This errors with E0425. It would be nice if cargo offered a way to explain the error in depth!

error[E0425]: cannot find value `hello` in this scope
 --> src/main.rs:2:5
  |
2 |     hello
  |     ^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0425`.
error: could not compile `tests` (bin "tests") due to 1 previous error

You can of course copy and paste the command but it would be nicer to not have to.

Proposed Solution

You could run cargo check --explain that opens up the help page for the given error.

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-infoStatus: Needs more info, such as a reproduction or more background for a feature request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions