Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When std is missing the error message is very poor #84418

Closed
Lokathor opened this issue Apr 22, 2021 · 1 comment · Fixed by #84450
Closed

When std is missing the error message is very poor #84418

Lokathor opened this issue Apr 22, 2021 · 1 comment · Fixed by #84450
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-resolve Area: Name/path resolution done by `rustc_resolve` specifically C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Lokathor
Copy link
Contributor

A newbie Rustacean was trying to use the gba crate and they forgot to put #![no_std] in the lib.rs of their downstream project. The GBA uses a Tier 3 target with build-std, and so they landed on this error:

error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv4t-none-eabi` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `gba-rust`

This is a poor experience. It's pretty vague about what went wrong, and has no suggestion of what the person can do to try and fix it.

Ideally, the error message should say something like:

std is required by cratenamehere because it does not declare #![no_std]

And then the user can have at least an idea of what to investigate.

@jonas-schievink
Copy link
Contributor

related: #32663

@jonas-schievink jonas-schievink added A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 22, 2021
@jyn514 jyn514 added the A-resolve Area: Name/path resolution done by `rustc_resolve` specifically label Apr 22, 2021
@bors bors closed this as completed in 379a55c Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-resolve Area: Name/path resolution done by `rustc_resolve` specifically C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants