Skip to content

Remove many RefCells from DocContext - #82305

Merged
bors merged 1 commit into
rust-lang:masterfrom
camelid:no-more-refcell
Feb 23, 2021
Merged

Remove many RefCells from DocContext#82305
bors merged 1 commit into
rust-lang:masterfrom
camelid:no-more-refcell

Conversation

@camelid

Copy link
Copy Markdown
Member

I left some of them so this change doesn't balloon in size and because
removing the RefCell in DocContext.resolver would require compiler
changes.

Thanks to @jyn514 for making this a lot easier with #82020!

r? @jyn514

@camelidcamelid added C-cleanup Category: PRs that clean code up or issues documenting cleanup. I-compiletime Issue: Problems and improvements with respect to compile times. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 19, 2021
@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 19, 2021
@camelid

Copy link
Copy Markdown
MemberAuthor

Waiting for CI to pass and then will do perf run.

Comment threadsrc/librustdoc/core.rs Outdated

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I left this one in because it seems the lifetimes get tricky because it's moved around.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment threadsrc/librustdoc/core.rs Outdated

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I left this one in because

  1. It would require semi-significant changes
  2. Ideally we're going to get rid of fake_def_ids at some point anyway (I think Joshua has an idea for that)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well, "at some point" is probably pretty far off. But I'm fine with waiting for a follow-up PR.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Note to future readers: I was able to remove this one in #82382.

Comment threadsrc/librustdoc/visit_lib.rs Outdated

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Might I say, LibEmbargoVisitor is one of the most interesting names I've seen in rust-lang/rust.

@camelid

Copy link
Copy Markdown
MemberAuthor

I've been eagerly watching the logs and the rustdoc testsuite just passed!

@bors try @rust-timer queue

@rust-timer

Copy link
Copy Markdown
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbotrustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 19, 2021
@bors

bors commented Feb 19, 2021

Copy link
Copy Markdown
Collaborator

⌛ Trying commit ab1be029dc3b5d2c2efa94ad7e508172ab5617a0 with merge 42c967a8b9046d57e776497be0724b4e1b1931c7...

@bors

bors commented Feb 19, 2021

Copy link
Copy Markdown
Collaborator

☀️ Try build successful - checks-actions
Build commit: 42c967a8b9046d57e776497be0724b4e1b1931c7 (42c967a8b9046d57e776497be0724b4e1b1931c7)

@rust-timer

Copy link
Copy Markdown
Collaborator

Queued 42c967a8b9046d57e776497be0724b4e1b1931c7 with parent 9b471a3, future comparison URL.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking try commit (42c967a8b9046d57e776497be0724b4e1b1931c7): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf

@rustbotrustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 20, 2021
@camelid

Copy link
Copy Markdown
MemberAuthor

Fairly small improvements, but they're in the right direction, and it cleans up the code.

Comment threadsrc/librustdoc/clean/inline.rs Outdated
@camelid

Copy link
Copy Markdown
MemberAuthor

Hmm, seems I have conflicts but bors hasn't reported yet.

@camelid
camelidforce-pushed the no-more-refcell branch 2 times, most recently from af3e95d to fb96100CompareFebruary 21, 2021 00:44
@camelid

Copy link
Copy Markdown
MemberAuthor

Rebased.

@camelid

Copy link
Copy Markdown
MemberAuthor

@bors r=@jyn514

@bors

bors commented Feb 21, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit fb9610030cfd4596d3c1fc5074338d38b5b2661d has been approved by jyn514

@borsbors 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 Feb 21, 2021
@bors

bors commented Feb 22, 2021

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #82393) made this pull request unmergeable. Please resolve the merge conflicts.

@borsbors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Feb 22, 2021
@borsbors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 22, 2021
I left some of them so this change doesn't balloon in size and because
removing the RefCell in `DocContext.resolver` would require compiler
changes.
Thanks to `@jyn514` for making this a lot easier with rust-lang#82020!
@camelid

Copy link
Copy Markdown
MemberAuthor

@bors r=@jyn514

@bors

bors commented Feb 22, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit e4ac499 has been approved by jyn514

@bors

bors commented Feb 22, 2021

Copy link
Copy Markdown
Collaborator

🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened.

@borsbors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 22, 2021
@jyn514

Copy link
Copy Markdown
Member

@bors rollup=iffy

This only affects rustdoc's perf, not the compiler's.

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 23, 2021
Rollup of 10 pull requests
Successful merges:
- rust-lang#81629 (Point out implicit deref coercions in borrow)
- rust-lang#82113 (Improve non_fmt_panic lint.)
- rust-lang#82258 (Implement -Z hir-stats for nested foreign items)
- rust-lang#82296 (Support `pub` on `macro_rules`)
- rust-lang#82297 (Consider auto derefs before warning about write only fields)
- rust-lang#82305 (Remove many RefCells from DocContext)
- rust-lang#82308 (Lower condition of `if` expression before it's "then" block)
- rust-lang#82311 (Jsondocck improvements)
- rust-lang#82362 (Fix mir-cfg dumps)
- rust-lang#82391 (disable atomic_max/min tests in Miri)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 8e67fe5 into rust-lang:masterFeb 23, 2021
@rustbotrustbot added this to the 1.52.0 milestone Feb 23, 2021
@camelid
camelid deleted the no-more-refcell branch February 24, 2021 04:51
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-cleanupCategory: PRs that clean code up or issues documenting cleanup.I-compiletimeIssue: Problems and improvements with respect to compile times.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@camelid@rust-timer@bors@jyn514@rust-highfive@rustbot