We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6045c34 commit a23e751Copy full SHA for a23e751
library/std/src/io/mod.rs
@@ -1155,7 +1155,9 @@ impl<'a> IoSliceMut<'a> {
1155
}
1156
1157
*bufs = &mut replace(bufs, &mut [])[remove..];
1158
- if !bufs.is_empty() {
+ if bufs.is_empty() {
1159
+ assert!(n == accumulated_len, "advancing io slices beyond their length");
1160
+ } else {
1161
bufs[0].advance(n - accumulated_len)
1162
1163
@@ -1289,7 +1291,9 @@ impl<'a> IoSlice<'a> {
1289
1291
1290
1292
1293
1294
1295
1296
1297
1298
1299
0 commit comments