added more context for duplicate lang item errors (fixes #60561) Some more information about #60561 -- these errors are pretty common when one works in restrictive environments with `no_std` or customized `std`, but they don't provide much context for debugging, as any transitive dependency could have brought in `std` crate. With that, currently, one needs to use something like `cargo tree` and investigate transitive dependencies one by one. It'll be more helpful to know at least the crate that uses `std` (which `cargo tree` doesn't show) to pin down this investigation when debugging. I'm not sure what the best way to get this context is inside rustc internals (I'm new to them). I found that `all_crate_nums` query returns the crates in some dependency order, so printing out the name of the preceding crate seems to do the trick. But I welcome suggestions if this can be done in a better way. |
||
|---|---|---|
| .. | ||
| benches | ||
| dep_graph | ||
| hir | ||
| ich | ||
| infer | ||
| lint | ||
| middle | ||
| mir | ||
| query | ||
| session | ||
| traits | ||
| ty | ||
| util | ||
| arena.rs | ||
| build.rs | ||
| Cargo.toml | ||
| error_codes.rs | ||
| lib.rs | ||
| macros.rs | ||
| README.md | ||
| tests.rs | ||
For more information about how rustc works, see the rustc guide.