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 ptr::metadata in <[T]>::len implementation #100848

Merged
merged 1 commit into from
Oct 24, 2022

Conversation

KamilaBorowska
Copy link
Contributor

This avoids duplication of ptr::metadata code.

I believe this is acceptable as the previous approach essentially duplicated ptr::metadata because back then rustc_allow_const_fn_unstable annotation did not exist.

I would like somebody to ping @rust-lang/wg-const-eval as the documentation says:

Always ping @rust-lang/wg-const-eval if you are adding more rustc_allow_const_fn_unstable attributes to any const fn.

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Aug 21, 2022
@rustbot
Copy link
Collaborator

rustbot commented Aug 21, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rust-highfive
Copy link
Collaborator

r? @m-ou-se

(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 Aug 21, 2022
This avoids duplication of ptr::metadata code.
@KamilaBorowska KamilaBorowska force-pushed the use-metadata-for-slice-len branch from 6d5e21c to 155b4c2 Compare August 21, 2022 15:20
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 8, 2022
@thomcc
Copy link
Member

thomcc commented Oct 23, 2022

This is a nice cleanup. I suppose it could impact compile-perf (len() is used a lot...), so I'll mark it as iffy with regards to rollup.

@bors r+ rollup=iffy

@bors
Copy link
Contributor

bors commented Oct 23, 2022

📌 Commit 155b4c2 has been approved by thomcc

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 23, 2022
@bors
Copy link
Contributor

bors commented Oct 24, 2022

⌛ Testing commit 155b4c2 with merge 56f1325...

@bors
Copy link
Contributor

bors commented Oct 24, 2022

☀️ Test successful - checks-actions
Approved by: thomcc
Pushing 56f1325 to master...

1 similar comment
@bors
Copy link
Contributor

bors commented Oct 24, 2022

☀️ Test successful - checks-actions
Approved by: thomcc
Pushing 56f1325 to master...

@bors bors added merged-by-bors This PR was explicitly merged by bors. labels Oct 24, 2022
@bors bors merged commit 56f1325 into rust-lang:master Oct 24, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 24, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (56f1325): comparison URL.

Overall result: ❌ regressions - 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)
1.0% [0.7%, 1.3%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.4%] 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)
1.4% [1.4%, 1.4%] 1
Regressions ❌
(secondary)
4.6% [4.6%, 4.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.5% [-4.9%, -4.2%] 2
All ❌✅ (primary) 1.4% [1.4%, 1.4%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

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-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants