Skip to content

Add the Provider api to core::any - #91970

Merged
bors merged 7 commits into
rust-lang:masterfrom
nrc:provide-any
Jun 10, 2022
Merged

Add the Provider api to core::any#91970
bors merged 7 commits into
rust-lang:masterfrom
nrc:provide-any

Conversation

@nrc

@nrcnrc commented Dec 15, 2021

Copy link
Copy Markdown
Member

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

@nrcnrc added T-libs-api [DEPRECATED; DO NOT USE] 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
Copy Markdown
Contributor

r? @scottmcm

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

@rust-highfiverust-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

bors commented Feb 1, 2022

Copy link
Copy Markdown
Collaborator

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

@scottmcmscottmcm 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
Comment threadlibrary/core/src/any.rs Outdated
Comment threadlibrary/core/src/any.rs
@Dylan-DPCDylan-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.

@yaahcyaahc mentioned this pull request Apr 13, 2022
7 tasks

@scottmcmscottmcm left a comment

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.

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

nrc commented May 11, 2022

Copy link
Copy Markdown
MemberAuthor

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

@Dylan-DPCDylan-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

@TimDiekmannTimDiekmann left a comment

Copy link
Copy Markdown
Contributor

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. 🙂

Comment threadlibrary/core/src/any.rs Outdated
Comment threadlibrary/core/src/any.rs Outdated
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

nrc commented Jun 6, 2022

Copy link
Copy Markdown
MemberAuthor

Comments addressed

@scottmcm

Copy link
Copy Markdown
Member

Thanks for the updates! Things look good to me.

@bors r+

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

@bors

bors commented Jun 9, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 6629010 has been approved by scottmcm

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

bors commented Jun 10, 2022

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 6629010 with merge e9aff9c...

@bors

bors commented Jun 10, 2022

Copy link
Copy Markdown
Collaborator

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

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Jun 10, 2022
@bors
bors merged commit e9aff9c into rust-lang:masterJun 10, 2022
@rustbotrustbot added this to the 1.63.0 milestone Jun 10, 2022
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (e9aff9c): comparison url.

Instruction count

  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: 😿 relevant regression found
mean1maxcount2
Regressions 😿
(primary)
N/AN/A0
Regressions 😿
(secondary)
0.3%0.3%1
Improvements 🎉
(primary)
-1.0%-1.0%1
Improvements 🎉
(secondary)
N/AN/A0
All 😿🎉 (primary)-1.0%-1.0%1

Max RSS (memory usage)

Results
  • Primary benchmarks: 😿 relevant regression found
  • Secondary benchmarks: 🎉 relevant improvements found
mean1maxcount2
Regressions 😿
(primary)
2.3%2.3%1
Regressions 😿
(secondary)
N/AN/A0
Improvements 🎉
(primary)
N/AN/A0
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
mean1maxcount2
Regressions 😿
(primary)
N/AN/A0
Regressions 😿
(secondary)
2.1%2.1%1
Improvements 🎉
(primary)
N/AN/A0
Improvements 🎉
(secondary)
N/AN/A0
All 😿🎉 (primary)N/AN/A0

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 change23

  2. number of relevant changes23

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-error-handlingArea: Error handlingmerged-by-borsThis PR was explicitly merged by bors.PG-error-handlingProject group: Error handling (https://github.com/rust-lang/project-error-handling)S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-libs-api[DEPRECATED; DO NOT USE]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

11 participants

@nrc@rust-highfive@rust-log-analyzer@bors@scottmcm@rust-timer@yaahc@bjorn3@TimDiekmann@rustbot@Dylan-DPC