Skip to content

Give a better error message when running cargo test on libstd itself #76444

Closed

Description

@jyn514

Right now, you get really terrible errors like this:

$ cargo test
error[E0277]: the size for values of type `()` cannot be known at compilation time
   --> /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.1.14/src/use_file.rs:30:44
    |
30  | pub fn getrandom_inner(dest: &mut [u8]) -> Result<(), Error> {
    |                                            ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `()`

162 times. It would be more helpful to instead say 'use x.py test instead'.

Activity

  1. added
    A-diagnosticsArea: Messages for errors, warnings, and lints
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    D-confusingDiagnostics: Confusing error or lint that should be reworked.
    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to Rust
    on Sep 7, 2020
  2. dawnFromDark commented on Dec 29, 2020

    @dawnFromDark
  3. jyn514 commented on Mar 29, 2022

    @jyn514
    MemberAuthor

    Fixed by #94796.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustA-diagnosticsArea: Messages for errors, warnings, and lintsD-confusingDiagnostics: Confusing error or lint that should be reworked.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions