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

Use u32 over Option<u32> in DebugLoc #82285

Merged
merged 2 commits into from
Mar 7, 2021
Merged

Conversation

nhwn
Copy link
Contributor

@nhwn nhwn commented Feb 19, 2021

Changes Option<u32> fields in DebugLoc to Option<NonZeroU32>. Since the respective fields (line and col) are guaranteed to be 1-based, this layout optimization is a freebie.

EDIT: Changes Option<u32> fields in DebugLoc to u32. As @bugadani pointed out, an Option<NonZeroU32> is probably an unnecessary layer of abstraction since the None variant is always used as UNKNOWN_LINE_NUMBER (which is just 0). Also, SourceInfo in metadata.rs already uses a u32 instead of an Option<u32> to encode the same information, so I think this change is warranted.

Since @jyn514 raised some concerns over measuring performance in a similar PR (#82255), does this need a perf run?

@rust-highfive
Copy link
Collaborator

r? @estebank

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 19, 2021
@nhwn nhwn changed the title Use Option<NonZeroU32> in DebugLoc Use u32 over Option<u32> in DebugLoc Feb 19, 2021
@rust-log-analyzer

This comment has been minimized.

@nagisa
Copy link
Member

nagisa commented Feb 19, 2021

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

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

bors commented Feb 19, 2021

⌛ Trying commit a5bfabf2084e207703fee5aae82a5be5f4c8a759 with merge 0b2cff598b5954727775051cc41563a0ecf6119f...

@bors
Copy link
Contributor

bors commented Feb 20, 2021

☀️ Try build successful - checks-actions
Build commit: 0b2cff598b5954727775051cc41563a0ecf6119f (0b2cff598b5954727775051cc41563a0ecf6119f)

@rust-timer
Copy link
Collaborator

Queued 0b2cff598b5954727775051cc41563a0ecf6119f with parent 9b471a3, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (0b2cff598b5954727775051cc41563a0ecf6119f): 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

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 20, 2021
@nagisa
Copy link
Member

nagisa commented Feb 20, 2021

@bors r+
r? @nagisa

@bors
Copy link
Contributor

bors commented Feb 20, 2021

📌 Commit a5bfabf2084e207703fee5aae82a5be5f4c8a759 has been approved by nagisa

@rust-highfive rust-highfive assigned nagisa and unassigned estebank Feb 20, 2021
@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 Feb 20, 2021
@nagisa
Copy link
Member

nagisa commented Feb 20, 2021

@bors r-

Please squash (some of) the commits together.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 20, 2021
@nhwn
Copy link
Contributor Author

nhwn commented Feb 23, 2021

@rustbot label -S-waiting-on-author +S-waiting-on-review

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 23, 2021
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 23, 2021
@nagisa
Copy link
Member

nagisa commented Mar 7, 2021

@bors r+

Sorry for not getting back to this sooner!

@bors
Copy link
Contributor

bors commented Mar 7, 2021

📌 Commit 408d402 has been approved by nagisa

@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 Mar 7, 2021
@bors
Copy link
Contributor

bors commented Mar 7, 2021

⌛ Testing commit 408d402 with merge 234781a...

@bors
Copy link
Contributor

bors commented Mar 7, 2021

☀️ Test successful - checks-actions
Approved by: nagisa
Pushing 234781a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 7, 2021
@bors bors merged commit 234781a into rust-lang:master Mar 7, 2021
@rustbot rustbot added this to the 1.52.0 milestone Mar 7, 2021
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants