diff options
Diffstat (limited to 'library/std/src/io/tests.rs')
| -rw-r--r-- | library/std/src/io/tests.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/library/std/src/io/tests.rs b/library/std/src/io/tests.rs index eb5d5988768..090a091b09a 100644 --- a/library/std/src/io/tests.rs +++ b/library/std/src/io/tests.rs @@ -210,6 +210,15 @@ fn read_buf_exact() { } #[test] +#[should_panic] +fn borrowed_cursor_advance_overflow() { + let mut buf = [0; 512]; + let mut buf = BorrowedBuf::from(&mut buf[..]); + buf.unfilled().advance(1); + buf.unfilled().advance(usize::MAX); +} + +#[test] fn take_eof() { struct R; |
