Conversation
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
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. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This is a separated commit to be easy to reverse later.
This reverts commit 6a30319.
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
☔ The latest upstream changes (presumably #154832) made this pull request unmergeable. Please resolve the merge conflicts. |
| #[stable(feature = "arc_io_traits", since = "CURRENT_RUSTC_VERSION")] | ||
| #[cfg(all(not(no_rc), not(no_sync), target_has_atomic = "ptr"))] | ||
| impl<R> Read for Arc<R> | ||
| where | ||
| R: Read, | ||
| for<'a> &'a R: Read, | ||
| { | ||
| fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { | ||
| (&**self).read(buf) | ||
| } | ||
| fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> { | ||
| (&**self).read_vectored(bufs) | ||
| } | ||
| fn read_buf(&mut self, cursor: BorrowedCursor<'_>) -> io::Result<()> { | ||
| (&**self).read_buf(cursor) | ||
| } | ||
| #[inline] | ||
| fn is_read_vectored(&self) -> bool { | ||
| (&**self).is_read_vectored() | ||
| } | ||
| fn read_to_end(&mut self, buf: &mut Vec<u8>) -> io::Result<usize> { | ||
| (&**self).read_to_end(buf) | ||
| } | ||
| fn read_to_string(&mut self, buf: &mut String) -> io::Result<usize> { | ||
| (&**self).read_to_string(buf) | ||
| } | ||
| } | ||
| #[stable(feature = "arc_io_traits", since = "CURRENT_RUSTC_VERSION")] | ||
| #[cfg(all(not(no_rc), not(no_sync), target_has_atomic = "ptr"))] | ||
| impl<W> Write for Arc<W> | ||
| where | ||
| W: Write, | ||
| for<'a> &'a W: Write, | ||
| { | ||
| fn write(&mut self, buf: &[u8]) -> io::Result<usize> { | ||
| (&**self).write(buf) | ||
| } | ||
| fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> { | ||
| (&**self).write_vectored(bufs) | ||
| } | ||
| #[inline] | ||
| fn is_write_vectored(&self) -> bool { | ||
| (&**self).is_write_vectored() | ||
| } | ||
| #[inline] | ||
| fn flush(&mut self) -> io::Result<()> { | ||
| (&**self).flush() | ||
| } | ||
| } | ||
| #[stable(feature = "arc_io_traits", since = "CURRENT_RUSTC_VERSION")] | ||
| #[cfg(all(not(no_rc), not(no_sync), target_has_atomic = "ptr"))] | ||
| impl<S> Seek for Arc<S> | ||
| where | ||
| S: Seek, | ||
| for<'a> &'a S: Seek, | ||
| { | ||
| fn seek(&mut self, pos: SeekFrom) -> io::Result<u64> { | ||
| (&**self).seek(pos) | ||
| } | ||
| fn stream_len(&mut self) -> io::Result<u64> { | ||
| (&**self).stream_len() | ||
| } | ||
| fn stream_position(&mut self) -> io::Result<u64> { | ||
| (&**self).stream_position() | ||
| } | ||
| } |
There was a problem hiding this comment.
These implementations have some potential issues. See #155684 for just this problem split out into its own PR.
Based on #152918
Tracking issue: #154046
Special things to note:
allocdoc testsArc. Unlike Generalize io for Arc #130675, this PR restricts the implementation more to avoid bad implementations such asArc<[u8]>.Another way to do this would be to bypass orphan rule. Is it possible in
std?