-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Remove all reference to DepGraph::work_products #50558
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @michaelwoerister (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
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.
Thanks, @whitfin! That's how I imagined the refactoring to look like.
I've never been very happy with the naming in this area, so changing them is a good idea. However, I think the names you chose make it less clear what the functions do. I left some suggestions for new names below.
@@ -55,22 +55,22 @@ pub fn save_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { | |||
}) | |||
} | |||
|
|||
pub fn save_work_products(sess: &Session, dep_graph: &DepGraph) { | |||
pub fn save_work_products(sess: &Session, |
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 could be renamed to save_work_product_index
.
@@ -234,10 +234,9 @@ fn encode_dep_graph(tcx: TyCtxt, | |||
Ok(()) | |||
} | |||
|
|||
fn encode_work_products(dep_graph: &DepGraph, | |||
fn encode_work_products(work_products: &FxHashMap<WorkProductId, WorkProduct>, |
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.
Rename to encode_work_product_index
.
cgu_name: &str, | ||
files: &[(WorkProductFileKind, PathBuf)]) { | ||
debug!("save_trans_partition({:?},{:?})", | ||
pub fn create_trans_partition(sess: &Session, |
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.
Rename to copy_cgu_workproducts_to_incr_comp_cache_dir
.
src/librustc_trans/back/write.rs
Outdated
fn copy_module_artifacts_into_incr_comp_cache(sess: &Session, | ||
dep_graph: &DepGraph, | ||
compiled_modules: &CompiledModules) { | ||
fn generate_module_artifacts( |
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.
Rename to copy_all_cgu_workproducts_to_incr_comp_cache_dir
Hi @michaelwoerister, thank you for the naming tips! I honestly had no idea why the names were what they were, so my changes were mostly guesses :p I have updated using your suggestions! |
Excellent, thanks for updating! @bors r+ |
📌 Commit 6d5ed01 has been approved by |
@bors rollup |
Rollup of 18 pull requests Successful merges: - #49423 (Extend tests for RFC1598 (GAT)) - #50010 (Give SliceIndex impls a test suite of girth befitting the implementation (and fix a UTF8 boundary check)) - #50447 (Fix update-references for tests within subdirectories.) - #50514 (Pull in a wasm fix from LLVM upstream) - #50524 (Make DepGraph::previous_work_products immutable) - #50532 (Don't use Lock for heavily accessed CrateMetadata::cnum_map.) - #50538 ( Make CrateNum allocation more thread-safe. ) - #50564 (Inline `Span` methods.) - #50565 (Use SmallVec for DepNodeIndex within dep_graph.) - #50569 (Allow for specifying a linker plugin for cross-language LTO) - #50572 (Clarify in the docs that `mul_add` is not always faster.) - #50574 (add fn `into_inner(self) -> (Idx, Idx)` to RangeInclusive (#49022)) - #50575 (std: Avoid `ptr::copy` if unnecessary in `vec::Drain`) - #50588 (Move "See also" disambiguation links for primitive types to top) - #50590 (Fix tuple struct field spans) - #50591 (Restore RawVec::reserve* documentation) - #50598 (Remove unnecessary mutable borrow and resizing in DepGraph::serialize) - #50606 (Retry when downloading the Docker cache.) Failed merges: - #50161 (added missing implementation hint) - #50558 (Remove all reference to DepGraph::work_products)
@michaelwoerister I had to update this for some changes on master after some merges; unsure if that means you have to re-approve? |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Yes, I have to re-approve everytime something changes. A quick ping after rebasing is helpful, thanks! Could you do a proper rebase though (e.g. |
@michaelwoerister ok, updated (I think)! Let me know if I rebased properly; not entirely sure if I did the right thing :p |
Looks good! @bors r+ |
📌 Commit 8402a58 has been approved by |
…ster Remove all reference to DepGraph::work_products This is an attempt at fixing rust-lang#50500. It will remove the `work_products` key from `DepGraphData` completely, in favour of just passing the relevant data around. I went in a little blindly; everything appears to work just fine but I'd appreciate any additional advice people. I didn't want to remove too much of what was already there, so I kept the structure pretty much the same (aside from some naming tweaks) - if anyone has suggestions on how to streamline it a little better, happy to follow up. r? @michaelwoerister
…ster Remove all reference to DepGraph::work_products This is an attempt at fixing rust-lang#50500. It will remove the `work_products` key from `DepGraphData` completely, in favour of just passing the relevant data around. I went in a little blindly; everything appears to work just fine but I'd appreciate any additional advice people. I didn't want to remove too much of what was already there, so I kept the structure pretty much the same (aside from some naming tweaks) - if anyone has suggestions on how to streamline it a little better, happy to follow up. r? @michaelwoerister
…ster Remove all reference to DepGraph::work_products This is an attempt at fixing rust-lang#50500. It will remove the `work_products` key from `DepGraphData` completely, in favour of just passing the relevant data around. I went in a little blindly; everything appears to work just fine but I'd appreciate any additional advice people. I didn't want to remove too much of what was already there, so I kept the structure pretty much the same (aside from some naming tweaks) - if anyone has suggestions on how to streamline it a little better, happy to follow up. r? @michaelwoerister
Rollup of 13 pull requests Successful merges: - #50544 (Cleanup some dependencies) - #50545 (Made some functions in time module const) - #50550 (use fmt::Result where applicable) - #50558 (Remove all reference to DepGraph::work_products) - #50602 (Update canonicalize docs) - #50607 (Allocate Symbol strings from an arena) - #50613 (Migrate the toolstate update bot to rust-highfive) - #50624 (fs::write: Add example writing a &str) - #50634 (Do not silently truncate offsets for `read_at`/`write_at` on emscripten) - #50644 (AppVeyor: Read back trace from crash dump on failure.) - #50661 (Ignore non .rs files for tidy libcoretest) - #50663 (rustc: Allow an edition's feature on that edition) - #50667 (rustc: Only suggest deleting `extern crate` if it works) Failed merges:
This is an attempt at fixing #50500. It will remove the
work_products
key fromDepGraphData
completely, in favour of just passing the relevant data around. I went in a little blindly; everything appears to work just fine but I'd appreciate any additional advice people.I didn't want to remove too much of what was already there, so I kept the structure pretty much the same (aside from some naming tweaks) - if anyone has suggestions on how to streamline it a little better, happy to follow up.
r? @michaelwoerister