You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's no fundamental reason to limit the io trait implementations on Arc to only File; they can equally be applied to any Arc<T> where &T: Trait. Arc isn't a fundamental type, so it's impossible for downstream crates to implement Read for Arc<LocalType>, thus this blanket impl is a non-breaking one (if I remembered the API evolution rules correctly).
ATTN: this PR makes insta-stable API changes.
Now that the impl is generalized it might be more proper to live in a different file, but I did this from the web editor.
rustbot has assigned @Noratrieb.
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
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
Sep 21, 2024
On second thought — this is a bad/dangerous implementation due to impls such as Read for &[u8], which adjusts the input reference. While it's easy to accidentally think &T: Trait means T: Trait but replacing &mut self with &self, more implementations are possible than that.
It does feel like there should be a way for such forwarding to be done, but this isn't it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties.T-libsRelevant to the library team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
5 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There's no fundamental reason to limit the io trait implementations on
Arcto onlyFile; they can equally be applied to anyArc<T> where &T: Trait.Arcisn't a fundamental type, so it's impossible for downstream crates to implementRead for Arc<LocalType>, thus this blanket impl is a non-breaking one (if I remembered the API evolution rules correctly).ATTN: this PR makes insta-stable API changes.
Now that the impl is generalized it might be more proper to live in a different file, but I did this from the web editor.