Skip to content

Commit 534708e

Browse files
committed
Auto merge of rust-lang#122312 - matthiaskrgr:rollup-0p8y7gg, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - rust-lang#122275 (disable OOM test in Miri) - rust-lang#122276 (io::Read trait: make it more clear when we are adressing implementations vs callers) - rust-lang#122277 (BorrowedCursor docs clarification) - rust-lang#122286 (use Instance::expect_resolve() instead of unwraping Instance::resolve()) - rust-lang#122290 (MIR printing: print the path of uneval'd const) - rust-lang#122293 (diagnostics: Do not suggest using `#[unix_sigpipe]` without a value) - rust-lang#122297 (bootstrap: document what the triples in 'Build' mean) - rust-lang#122302 (docs: Correct ptr/ref verbiage in SliceIndex docs.) - rust-lang#122304 (fix metadata for dyn-star in new solver) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9119a88 + 7efbdd3 commit 534708e

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

core/src/io/borrowed_buf.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,11 @@ impl<'data> BorrowedBuf<'data> {
139139
}
140140
}
141141

142-
/// A writeable view of the unfilled portion of a [`BorrowedBuf`](BorrowedBuf).
142+
/// A writeable view of the unfilled portion of a [`BorrowedBuf`].
143+
///
144+
/// The unfilled portion consists of an initialized and an uninitialized part; see [`BorrowedBuf`]
145+
/// for details.
143146
///
144-
/// Provides access to the initialized and uninitialized parts of the underlying `BorrowedBuf`.
145147
/// Data can be written directly to the cursor by using [`append`](BorrowedCursor::append) or
146148
/// indirectly by getting a slice of part or all of the cursor and writing into the slice. In the
147149
/// indirect case, the caller must call [`advance`](BorrowedCursor::advance) after writing to inform

core/src/slice/index.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -180,19 +180,19 @@ pub unsafe trait SliceIndex<T: ?Sized>: private_slice_index::Sealed {
180180
#[unstable(feature = "slice_index_methods", issue = "none")]
181181
fn get_mut(self, slice: &mut T) -> Option<&mut Self::Output>;
182182

183-
/// Returns a shared reference to the output at this location, without
183+
/// Returns a pointer to the output at this location, without
184184
/// performing any bounds checking.
185185
/// Calling this method with an out-of-bounds index or a dangling `slice` pointer
186-
/// is *[undefined behavior]* even if the resulting reference is not used.
186+
/// is *[undefined behavior]* even if the resulting pointer is not used.
187187
///
188188
/// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
189189
#[unstable(feature = "slice_index_methods", issue = "none")]
190190
unsafe fn get_unchecked(self, slice: *const T) -> *const Self::Output;
191191

192-
/// Returns a mutable reference to the output at this location, without
192+
/// Returns a mutable pointer to the output at this location, without
193193
/// performing any bounds checking.
194194
/// Calling this method with an out-of-bounds index or a dangling `slice` pointer
195-
/// is *[undefined behavior]* even if the resulting reference is not used.
195+
/// is *[undefined behavior]* even if the resulting pointer is not used.
196196
///
197197
/// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
198198
#[unstable(feature = "slice_index_methods", issue = "none")]

std/src/io/mod.rs

+7-10
Original file line numberDiff line numberDiff line change
@@ -692,10 +692,9 @@ pub trait Read {
692692
/// Callers have to ensure that no unchecked out-of-bounds accesses are possible even if
693693
/// `n > buf.len()`.
694694
///
695-
/// No guarantees are provided about the contents of `buf` when this
696-
/// function is called, so implementations cannot rely on any property of the
697-
/// contents of `buf` being true. It is recommended that *implementations*
698-
/// only write data to `buf` instead of reading its contents.
695+
/// *Implementations* of this method can make no assumptions about the contents of `buf` when
696+
/// this function is called. It is recommended that implementations only write data to `buf`
697+
/// instead of reading its contents.
699698
///
700699
/// Correspondingly, however, *callers* of this method in unsafe code must not assume
701700
/// any guarantees about how the implementation uses `buf`. The trait is safe to implement,
@@ -901,12 +900,10 @@ pub trait Read {
901900
/// This function reads as many bytes as necessary to completely fill the
902901
/// specified buffer `buf`.
903902
///
904-
/// No guarantees are provided about the contents of `buf` when this
905-
/// function is called, so implementations cannot rely on any property of the
906-
/// contents of `buf` being true. It is recommended that implementations
907-
/// only write data to `buf` instead of reading its contents. The
908-
/// documentation on [`read`] has a more detailed explanation on this
909-
/// subject.
903+
/// *Implementations* of this method can make no assumptions about the contents of `buf` when
904+
/// this function is called. It is recommended that implementations only write data to `buf`
905+
/// instead of reading its contents. The documentation on [`read`] has a more detailed
906+
/// explanation of this subject.
910907
///
911908
/// # Errors
912909
///

std/src/io/tests.rs

+2
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,8 @@ fn read_buf_full_read() {
694694
}
695695

696696
#[test]
697+
// Miri does not support signalling OOM
698+
#[cfg_attr(miri, ignore)]
697699
// 64-bit only to be sure the allocator will fail fast on an impossible to satsify size
698700
#[cfg(target_pointer_width = "64")]
699701
fn try_oom_error() {

0 commit comments

Comments
 (0)