mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-05 03:36:21 +00:00

Stop using CRATE_DEF_INDEX outside of metadata encoding. `CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want. We should not manipulate raw `DefIndex` outside of metadata encoding.
Please read the rustc-dev-guide chapter on Backend Agnostic Codegen.