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

Streamline register_res. #101830

Merged
merged 1 commit into from
Sep 15, 2022
Merged

Conversation

nnethercote
Copy link
Contributor

Turns out it's only ever passed a Res::Def.

r? @jyn514

Turns out it's only ever passed a `Res::Def`.
@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Sep 14, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 14, 2022
@jyn514
Copy link
Member

jyn514 commented Sep 14, 2022

I think it's true that the Res stored in a Path can only ever be a Res::Def; otherwise it won't have a path.

I see some places where it's a Res::Local instead, but rustdoc doesn't look at function bodies, so those won't show up.

@jyn514
Copy link
Member

jyn514 commented Sep 14, 2022

@bors r+ rollup=iffy

@bors
Copy link
Collaborator

bors commented Sep 14, 2022

📌 Commit 0965a33 has been approved by jyn514

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 Sep 14, 2022
@nnethercote
Copy link
Contributor Author

nnethercote commented Sep 14, 2022

I think it's true that the Res stored in a Path can only ever be a Res::Def; otherwise it won't have a path.

That's not true, a Path can contain Res::Local, Res::Err, Res::PrimTy, Res::SelfTy. This patch works because of other constraints, e.g. one of the following.

  • The Res comes from a trait definition, which seems to always be Res::Def.
  • A Res::Def is constructed right at the register_res call site.
  • The Res comes from a type definition, and the Res::PrimTy and Res::SelfTy variants are handled separately, as is the Res::Def(DefKind::TyParam, _) case.

@bors
Copy link
Collaborator

bors commented Sep 15, 2022

⌛ Testing commit 0965a33 with merge c3f5929...

@bors
Copy link
Collaborator

bors commented Sep 15, 2022

☀️ Test successful - checks-actions
Approved by: jyn514
Pushing c3f5929 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 15, 2022
@bors bors merged commit c3f5929 into rust-lang:master Sep 15, 2022
@rustbot rustbot added this to the 1.65.0 milestone Sep 15, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c3f5929): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.3% [-1.3%, -1.3%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.2% [3.3%, 7.0%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
3.4% [3.4%, 3.4%] 1
Regressions ❌
(secondary)
4.6% [2.4%, 6.3%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.4% [3.4%, 3.4%] 1

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@nnethercote nnethercote deleted the streamline-register_res branch September 15, 2022 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant 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