Skip to content

100s of irrelevant errors when a crate cannot be loaded #154096

Closed

Description

@RalfJung

When something is wrong with the rustc setup and a key crate cannot be loaded (such as libstd, or one of the rustc_ crates when building a tool like Miri), there are 100s of error messages and most of them are useless. Specifically when building Miri without having the rustc_ crates, the first errors make sense:

error[E0463]: can't find crate for `rustc_abi`
  --> src/lib.rs:63:1
   |
63 | extern crate rustc_abi;
   | ^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_apfloat`
  --> src/lib.rs:64:1
   |
64 | extern crate rustc_apfloat;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_ast`
  --> src/lib.rs:65:1
   |
65 | extern crate rustc_ast;
   | ^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error[E0463]: can't find crate for `rustc_codegen_ssa`
  --> src/lib.rs:66:1
   |
66 | extern crate rustc_codegen_ssa;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

But then it goes on like this:

error[E0432]: unresolved imports `crate::InterpResult`, `crate::interp_ok`
 --> src/borrow_tracker/stacked_borrows/stack.rs:9:13
  |
9 | use crate::{InterpResult, ProvenanceExtra, interp_ok};
  |             ^^^^^^^^^^^^                   ^^^^^^^^^ no `interp_ok` in the root
  |             |
  |             no `InterpResult` in the root
  |
  = note: unresolved item `crate::concurrency::genmc::intercept::InterpResult` exists but is inaccessible

error[E0432]: unresolved import `InterpErrorKind`
   --> src/diagnostics.rs:234:9
    |
234 |     use InterpErrorKind::*;
    |         ^^^^^^^^^^^^^^^ use of undeclared type `InterpErrorKind`

error[E0432]: unresolved import `UndefinedBehaviorInfo`
   --> src/diagnostics.rs:235:9
    |
235 |     use UndefinedBehaviorInfo::*;
    |         ^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `UndefinedBehaviorInfo`

error: cannot find macro `throw_machine_stop` in this scope
   --> src/alloc_addresses/mod.rs:375:17
    |
375 |                 throw_machine_stop!(TerminationInfo::Int2PtrWithStrictProvenance);
    |                 ^^^^^^^^^^^^^^^^^^

This goes on forever.

error: could not compile `miri` (lib) due to 282 previous errors; 2 warnings emitted

Instead I would expect rustc to stop after complaining about the missing crates; everything else is just useless noise.

(I was sure I already filed this as an issue but I couldn't find it...)

Activity

  1. added
    A-diagnosticsArea: Messages for errors, warnings, and lints
    D-verboseDiagnostics: Too much output caused by a single piece of incorrect code.
    on Mar 19, 2026
  2. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Mar 19, 2026
  3. self-assigned this
    on Mar 27, 2026
  4. chenyukang commented on Apr 2, 2026

    @chenyukang
    Member

    I guess you're referring to this issue #118130

  5. added a commit that references this issue on Apr 2, 2026
    1e9f93f
  6. added a commit that references this issue on Apr 3, 2026
    c0c22d1
  7. added a commit that references this issue on Apr 3, 2026
    6b49378
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsD-verboseDiagnostics: Too much output caused by a single piece of incorrect code.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