Skip to content

Conversation

@yaahc
Copy link
Member

@yaahc yaahc commented Dec 16, 2025

Adds guidance on a specific provider API implementation anti pattern that implementers of the error trait should avoid.

resolves #99301 (comment)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 16, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 16, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

/// }
/// ```
///
/// # Implementation Conventions
Copy link
Member Author

Choose a reason for hiding this comment

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

I put this at the bottom of the existing doc comment but I wasn't sure if I should feature this more prominently, the only issue is I felt like it might be confusing to provide an example of what not to do before an example of how to use it properly, but the pre-existing example is quite long so I also worry that readers will entirely miss the new section.

@yaahc yaahc force-pushed the provider-doc-update branch 2 times, most recently from c2fcd93 to 39760d5 Compare December 16, 2025 22:02
@rust-log-analyzer

This comment has been minimized.

@yaahc yaahc force-pushed the provider-doc-update branch from 39760d5 to b30716c Compare December 16, 2025 23:22
@rust-log-analyzer

This comment has been minimized.

@juntyr

This comment was marked as resolved.

@yaahc yaahc force-pushed the provider-doc-update branch from b30716c to dd8a64a Compare December 18, 2025 20:54
@rustbot

This comment has been minimized.

@yaahc yaahc force-pushed the provider-doc-update branch from dd8a64a to e6f8696 Compare December 18, 2025 20:57
@rust-log-analyzer

This comment has been minimized.

@yaahc yaahc force-pushed the provider-doc-update branch from e6f8696 to cab124b Compare December 18, 2025 23:00
@rustbot
Copy link
Collaborator

rustbot commented Dec 18, 2025

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@yaahc yaahc force-pushed the provider-doc-update branch from cab124b to 61fd451 Compare December 18, 2025 23:14
@rust-log-analyzer

This comment has been minimized.

@yaahc yaahc force-pushed the provider-doc-update branch from 61fd451 to beee074 Compare December 18, 2025 23:59
@yaahc yaahc force-pushed the provider-doc-update branch from beee074 to b007397 Compare December 19, 2025 03:08
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

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

r=me either way depending on how you feel about it

View changes since this review

/// unintended duplication of information in error reports or require heuristics to deduplicate.
///
/// In other words, the following implementation pattern for `provide` is discouraged and should
/// not be used for [`Error`] types exposed in public APIs to third parties.
Copy link
Member

Choose a reason for hiding this comment

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

What is the use case for internal errors?

It seems like we could just say "don't do this", it seems clear that in fully private code people can always do whatever they want?

@Mark-Simulacrum Mark-Simulacrum 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 Dec 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

Tracking Issue for error_generic_member_access

6 participants