`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.
itertools
Please read the rustc-dev-guide chapter on Backend Agnostic Codegen.