-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Stop using CRATE_DEF_INDEX outside of metadata encoding. #96142
Conversation
`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.
Some changes occurred in cc @camelid Some changes occurred in src/tools/clippy. cc @rust-lang/clippy |
(rust-highfive has picked a reviewer for you, use r? to override) |
@@ -316,7 +303,7 @@ fn upstream_monomorphizations_provider( | |||
// If there are multiple monomorphizations available, | |||
// we select one deterministically. | |||
let other_cnum = *e.get(); | |||
if cnum_stable_ids[other_cnum] > cnum_stable_ids[cnum] { | |||
if tcx.stable_crate_id(other_cnum) > tcx.stable_crate_id(cnum) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand this is a different order than used previously, but it's still deterministic so it's ok.
@bors r+ |
📌 Commit 07ee031 has been approved by |
…ochenkov 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.
…ochenkov 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.
…ochenkov 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.
Rollup of 6 pull requests Successful merges: - rust-lang#94493 (Improved diagnostic on failure to meet send bound on future in a foreign crate) - rust-lang#95809 (Fix typo in bootstrap.py) - rust-lang#96086 (Remove `--extern-location` and all associated code) - rust-lang#96089 (`alloc`: make `vec!` unavailable under `no_global_oom_handling`) - rust-lang#96122 (Fix an invalid error for a suggestion to add a slice in pattern-matching) - rust-lang#96142 (Stop using CRATE_DEF_INDEX outside of metadata encoding.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…ochenkov 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.
CRATE_DEF_ID
andCrateNum::as_def_id
are almost always what we want. We should not manipulate rawDefIndex
outside of metadata encoding.