-
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
CStore switch FxHashMap to IndexVec #46913
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
Your code does not compile:
|
src/librustc_metadata/cstore.rs
Outdated
@@ -111,18 +111,25 @@ impl CStore { | |||
} | |||
|
|||
pub fn get_crate_data(&self, cnum: CrateNum) -> Rc<CrateMetadata> { | |||
self.metas.borrow().get(&cnum).unwrap().clone() | |||
self.metas.borrow().get(cnum).unwrap().unwrap().clone() |
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.
Use self.metas.borrow()[cnum].clone().unwrap()
to fix the borrow error
src/librustc_metadata/cstore.rs
Outdated
} | ||
|
||
pub fn set_crate_data(&self, cnum: CrateNum, data: Rc<CrateMetadata>) { | ||
self.metas.borrow_mut().insert(cnum, data); | ||
use rustc_data_structures::indexed_vec::Idx; | ||
let met = self.metas.borrow_mut(); |
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.
This needs to be let mut met
Thanks for the heads up. I got distracted trying to test locally. |
Ok, I am confused, what does that test fail have to do with my changes? |
@Eh2406 Assuming that you are referring to the change to the output for ui/print_type_sizes/niche-filling.rs ... here is my current understanding... I think we are seeing some (currently undiagnosed) non-deterministic treatment of You can see some recent notes from me on this at #46905, in particular the commit message for 5f85764 Note in particular that that tests originally said
Entry::Occupied(mut entry) => {
// If `child` is defined in crate `cnum`, ensure
// that it is mapped to a parent in `cnum`.
if child.krate == cnum && entry.get().krate != cnum {
entry.insert(parent);
}
}
In the meantime, I personally would be fine with you just updating the print-type-sizes.stdout to match the new output. (Which after all is the same as the old output...) |
Ok so I switched from |
Any ideas what is up with these errors? Why would this change lead to differences in the error messages? |
r? @pnkfelix |
Is there any Ideas on how to proceed? Should I try a rebase? |
All the PRs referenced by @pnkfelix have been merged, so I tried a rebase (and I squashed while I was doing). We will see if it works. |
Ping. The test got fixed by other prs. So this is now back to being a small simple change, with green CI. |
@bors r+ |
📌 Commit 2c69473 has been approved by |
⌛ Testing commit 2c69473 with merge 10f980c9f3977872cf1fddb6a4e9986d945c2bbd... |
💔 Test failed - status-appveyor |
Time out on appveyor. So did the last few commits. So we are on hold for that to get straightened out, yes? |
CStore switch FxHashMap to IndexVec This is a first attempt to fix #46876.
☀️ Test successful - status-appveyor, status-travis |
This is a first attempt to fix #46876.