Skip to content
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

rustc_borrowck memory management tweaks #131225

Merged
merged 5 commits into from
Oct 7, 2024

Conversation

nnethercote
Copy link
Contributor

Minor cleanups in rustc_borrowck relating to memory management.

r? @lqd

The `regioncx` and `borrow_set` fields can be references instead of
`Rc`. They use the existing `'a` lifetime. This avoids some heap
allocations and is a bit simpler.
It can own these two fields.
Either `&T` or `Rc<T>` is preferable.
By making it own two of its fields.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 4, 2024
@lqd
Copy link
Member

lqd commented Oct 7, 2024

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 7, 2024

📌 Commit c69d174 has been approved by lqd

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 7, 2024
@@ -150,14 +150,14 @@ pub(crate) fn type_check<'a, 'tcx>(
infcx,
param_env,
implicit_region_bound,
universal_regions,
Copy link
Contributor

@klensy klensy Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rc clone()'s better be Rc::clone, so whenever field refactored out of Rc, compiler will warn, instead of wasting clone()'s.

Actually, i want lint for it :-) : https://rust-lang.github.io/rust-clippy/master/index.html#/clone_on_ref_ptr

Copy link
Member

@lqd lqd Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m aware and prefer Rc::clone, but it’s fine until the lint is used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitted #131375, but is some discussion required before enabling it in CI?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems likely

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 7, 2024
…kingjubilee

Rollup of 7 pull requests

Successful merges:

 - rust-lang#128721 (Don't allow the `#[pointee]` attribute where it doesn't belong)
 - rust-lang#130479 (skip in-tree compiler build for llvm-bitcode-linker if ci-rustc is on)
 - rust-lang#130899 (Couple of changes to make it easier to compile rustc for wasm)
 - rust-lang#131225 (`rustc_borrowck` memory management tweaks)
 - rust-lang#131351 (Remove valgrind test suite and support from compiletest, bootstrap and opt-dist)
 - rust-lang#131359 (Fix used_underscore_binding in rustc_serialize)
 - rust-lang#131367 (Mark Boxy as on vacation)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9c4732a into rust-lang:master Oct 7, 2024
6 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Oct 7, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 7, 2024
Rollup merge of rust-lang#131225 - nnethercote:rustc_borrowck-mm, r=lqd

`rustc_borrowck` memory management tweaks

Minor cleanups in `rustc_borrowck` relating to memory management.

r? `@lqd`
@nnethercote nnethercote deleted the rustc_borrowck-mm branch October 7, 2024 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants