Skip to content

Commit 76e738f

Browse files
committed
Auto merge of #106023 - JohnTitor:rollup-k8mettz, r=JohnTitor
Rollup of 8 pull requests Successful merges: - #105584 (add assert messages if chunks/windows are length 0) - #105602 (interpret: add read_machine_[ui]size convenience methods) - #105824 (str.lines() docstring: clarify that line endings are not returned) - #105980 (Refer to "Waker" rather than "RawWaker" in `drop` comment) - #105986 (Fix typo in reading_half_a_pointer.rs) - #105995 (Add regression test for #96530) - #106008 (Sort lint_groups in no_lint_suggestion) - #106014 (Add comment explaining what the scrape-examples-toggle.goml GUI test is about) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 2099db2 + ae15900 commit 76e738f

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

core/src/slice/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ impl<T> [T] {
893893
#[stable(feature = "chunks_exact", since = "1.31.0")]
894894
#[inline]
895895
pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T> {
896-
assert_ne!(chunk_size, 0);
896+
assert_ne!(chunk_size, 0, "chunks cannot have a size of zero");
897897
ChunksExact::new(self, chunk_size)
898898
}
899899

@@ -935,7 +935,7 @@ impl<T> [T] {
935935
#[stable(feature = "chunks_exact", since = "1.31.0")]
936936
#[inline]
937937
pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T> {
938-
assert_ne!(chunk_size, 0);
938+
assert_ne!(chunk_size, 0, "chunks cannot have a size of zero");
939939
ChunksExactMut::new(self, chunk_size)
940940
}
941941

@@ -1017,7 +1017,7 @@ impl<T> [T] {
10171017
#[inline]
10181018
#[must_use]
10191019
pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T]) {
1020-
assert_ne!(N, 0);
1020+
assert_ne!(N, 0, "chunks cannot have a size of zero");
10211021
let len = self.len() / N;
10221022
let (multiple_of_n, remainder) = self.split_at(len * N);
10231023
// SAFETY: We already panicked for zero, and ensured by construction
@@ -1048,7 +1048,7 @@ impl<T> [T] {
10481048
#[inline]
10491049
#[must_use]
10501050
pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]]) {
1051-
assert_ne!(N, 0);
1051+
assert_ne!(N, 0, "chunks cannot have a size of zero");
10521052
let len = self.len() / N;
10531053
let (remainder, multiple_of_n) = self.split_at(self.len() - len * N);
10541054
// SAFETY: We already panicked for zero, and ensured by construction
@@ -1087,7 +1087,7 @@ impl<T> [T] {
10871087
#[unstable(feature = "array_chunks", issue = "74985")]
10881088
#[inline]
10891089
pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N> {
1090-
assert_ne!(N, 0);
1090+
assert_ne!(N, 0, "chunks cannot have a size of zero");
10911091
ArrayChunks::new(self)
10921092
}
10931093

@@ -1166,7 +1166,7 @@ impl<T> [T] {
11661166
#[inline]
11671167
#[must_use]
11681168
pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T]) {
1169-
assert_ne!(N, 0);
1169+
assert_ne!(N, 0, "chunks cannot have a size of zero");
11701170
let len = self.len() / N;
11711171
let (multiple_of_n, remainder) = self.split_at_mut(len * N);
11721172
// SAFETY: We already panicked for zero, and ensured by construction
@@ -1203,7 +1203,7 @@ impl<T> [T] {
12031203
#[inline]
12041204
#[must_use]
12051205
pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]]) {
1206-
assert_ne!(N, 0);
1206+
assert_ne!(N, 0, "chunks cannot have a size of zero");
12071207
let len = self.len() / N;
12081208
let (remainder, multiple_of_n) = self.split_at_mut(self.len() - len * N);
12091209
// SAFETY: We already panicked for zero, and ensured by construction
@@ -1244,7 +1244,7 @@ impl<T> [T] {
12441244
#[unstable(feature = "array_chunks", issue = "74985")]
12451245
#[inline]
12461246
pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N> {
1247-
assert_ne!(N, 0);
1247+
assert_ne!(N, 0, "chunks cannot have a size of zero");
12481248
ArrayChunksMut::new(self)
12491249
}
12501250

@@ -1276,7 +1276,7 @@ impl<T> [T] {
12761276
#[unstable(feature = "array_windows", issue = "75027")]
12771277
#[inline]
12781278
pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N> {
1279-
assert_ne!(N, 0);
1279+
assert_ne!(N, 0, "windows cannot have a size of zero");
12801280
ArrayWindows::new(self)
12811281
}
12821282

core/src/str/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -970,8 +970,10 @@ impl str {
970970

971971
/// An iterator over the lines of a string, as string slices.
972972
///
973-
/// Lines are ended with either a newline (`\n`) or a carriage return with
974-
/// a line feed (`\r\n`).
973+
/// Lines are split at line endings that are either newlines (`\n`) or
974+
/// sequences of a carriage return followed by a line feed (`\r\n`).
975+
///
976+
/// Line terminators are not included in the lines returned by the iterator.
975977
///
976978
/// The final line ending is optional. A string that ends with a final line
977979
/// ending will return the same lines as an otherwise identical string

core/src/task/wake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub struct RawWakerVTable {
104104
/// pointer.
105105
wake_by_ref: unsafe fn(*const ()),
106106

107-
/// This function gets called when a [`RawWaker`] gets dropped.
107+
/// This function gets called when a [`Waker`] gets dropped.
108108
///
109109
/// The implementation of this function must make sure to release any
110110
/// resources that are associated with this instance of a [`RawWaker`] and
@@ -151,7 +151,7 @@ impl RawWakerVTable {
151151
///
152152
/// # `drop`
153153
///
154-
/// This function gets called when a [`RawWaker`] gets dropped.
154+
/// This function gets called when a [`Waker`] gets dropped.
155155
///
156156
/// The implementation of this function must make sure to release any
157157
/// resources that are associated with this instance of a [`RawWaker`] and

0 commit comments

Comments
 (0)