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

Add the Provider api to core::any #91970

Merged
merged 7 commits into from
Jun 10, 2022
Merged

Add the Provider api to core::any #91970

merged 7 commits into from
Jun 10, 2022

Conversation

nrc
Copy link
Member

@nrc nrc commented Dec 15, 2021

This is an implementation of RFC 3192 (which is yet to be merged, thus why this is a draft PR). It adds an API for type-driven requests and provision of data from trait objects. A primary use case is for the Error trait, though that is not implemented in this PR. The only major difference to the RFC is that the functionality is added to the any module, rather than being in a sibling provide_any module (as discussed in the RFC thread).

Still todo: improve documentation on items, including adding examples.

cc @yaahc

@nrc nrc added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. A-error-handling Area: Error handling PG-error-handling Project group: Error handling (https://github.com/rust-lang/project-error-handling) labels Dec 15, 2021
@rust-highfive
Copy link
Collaborator

r? @scottmcm

(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 Dec 15, 2021
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Feb 1, 2022

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

@scottmcm scottmcm 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-review Status: Awaiting review from the assignee but also interested parties. labels Feb 2, 2022
library/core/src/any.rs Outdated Show resolved Hide resolved
library/core/src/any.rs Show resolved Hide resolved
@Dylan-DPC Dylan-DPC added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 7, 2022
@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@scottmcm scottmcm left a comment

Choose a reason for hiding this comment

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

Sorry for taking a while for getting to this.

While some of the comments I'm confident in, others I'm not tied to at all. As always, feel free to push back on anything you feel differently about.

@nrc
Copy link
Member Author

nrc commented May 11, 2022

@scottmcm thanks for the review, they were very useful comments. I think I have addressed the comments, please take another look!

@Dylan-DPC Dylan-DPC added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 14, 2022
Copy link
Member

@TimDiekmann TimDiekmann left a comment

Choose a reason for hiding this comment

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

Clippy gives two suggestions, I added them as a review. 🙂

library/core/src/any.rs Outdated Show resolved Hide resolved
library/core/src/any.rs Outdated Show resolved Hide resolved
nrc added 7 commits June 6, 2022 12:10
Signed-off-by: Nick Cameron <nrc@ncameron.org>
… is not required

Signed-off-by: Nick Cameron <nrc@ncameron.org>
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Signed-off-by: Nick Cameron <nrc@ncameron.org>
@nrc
Copy link
Member Author

nrc commented Jun 6, 2022

Comments addressed

@scottmcm
Copy link
Member

scottmcm commented Jun 9, 2022

Thanks for the updates! Things look good to me.

@bors r+

(And sorry for taking a while to rereview after the changes.)

@bors
Copy link
Contributor

bors commented Jun 9, 2022

📌 Commit 6629010 has been approved by scottmcm

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

bors commented Jun 10, 2022

⌛ Testing commit 6629010 with merge e9aff9c...

@bors
Copy link
Contributor

bors commented Jun 10, 2022

☀️ Test successful - checks-actions
Approved by: scottmcm
Pushing e9aff9c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 10, 2022
@bors bors merged commit e9aff9c into rust-lang:master Jun 10, 2022
@rustbot rustbot added this to the 1.63.0 milestone Jun 10, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e9aff9c): comparison url.

Instruction count

  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
0.3% 0.3% 1
Improvements 🎉
(primary)
-1.0% -1.0% 1
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) -1.0% -1.0% 1

Max RSS (memory usage)

Results
  • Primary benchmarks: 😿 relevant regression found
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
2.3% 2.3% 1
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-3.0% -3.8% 3
All 😿🎉 (primary) 2.3% 2.3% 1

Cycles

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
2.1% 2.1% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) N/A N/A 0

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-error-handling Area: Error handling merged-by-bors This PR was explicitly merged by bors. PG-error-handling Project group: Error handling (https://github.com/rust-lang/project-error-handling) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet