Skip to content

rustc could provide more help for debugging no_std duplicate_lang item errors #60561

Closed
@brenzi

Description

@brenzi

I'm currently porting crates to support no_std to use them with https://github.com/baidu/rust-sgx-sdk

The Problem:
any sub-dependency can break no_std, resulting in an error like this:

error: duplicate lang item in crate `std`: `f32_runtime`.
  |
  = note: first defined in crate `sgx_tstd`.

error: duplicate lang item in crate `std`: `f64_runtime`.
  |
  = note: first defined in crate `sgx_tstd`.

error: duplicate lang item in crate `std`: `panic_impl`.
  |
  = note: first defined in crate `sgx_tstd`.

error: duplicate lang item in crate `std`: `oom`.
  |
  = note: first defined in crate `sgx_trts`.

The compiler doesn't give me any hint, which (sub)dependency causes this issue. Like this it is very annoying and time-consuming to sort out such errors.

Would it be possible that rustc gives us a hint to colliding crates?

Maybe something like https://github.com/sfackler/cargo-tree could help visualizing no_std crates automatically?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-lang-itemArea: Language itemsC-enhancementCategory: An issue proposing an enhancement or a PR with one.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