Skip to content

Surface multiple "can't find crate" errors at a time #90702

Closed

Description

It would be nice if rustc could surface multiple "can't find crate xxxx" errors at once, instead of one at a time.

Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=6a10dfbf5f9cc7dc6488fc9c3efaec70

extern crate asdf;
extern crate foobar;

fn main() {}

The current output is:

error[E0463]: can't find crate for `asdf`
 --> src/main.rs:2:1
  |
2 | extern crate asdf;
  | ^^^^^^^^^^^^^^^^^^ can't find crate

For more information about this error, try `rustc --explain E0463`.
error: could not compile `playground` due to previous error

Ideally the output should look like:

error[E0463]: can't find crate for `asdf`
 --> src/main.rs:2:1
  |
2 | extern crate asdf;
  | ^^^^^^^^^^^^^^^^^^ can't find crate

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `foobar`
 --> src/main.rs:3:1
  |
3 | extern crate foobar;
  | ^^^^^^^^^^^^^^^^^^^^ can't find crate

For more information about this error, try `rustc --explain E0463`.
error: could not compile `playground` due to previous error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-resolveArea: Name resolutionE-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions