File tree 2 files changed +24
-0
lines changed
tests/run-make/dump-ice-to-disk 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -475,6 +475,24 @@ impl<A: Allocator> Read for VecDeque<u8, A> {
475
475
}
476
476
}
477
477
478
+ /// BufRead is implemented for `VecDeque<u8>` by reading bytes from the front of the `VecDeque`.
479
+ #[ stable( feature = "vecdeque_buf_read" , since = "CURRENT_RUSTC_VERSION" ) ]
480
+ impl < A : Allocator > BufRead for VecDeque < u8 , A > {
481
+ /// Returns the contents of the "front" slice as returned by
482
+ /// [`as_slices`][`VecDeque::as_slices`]. If the contained byte slices of the `VecDeque` are
483
+ /// discontiguous, multiple calls to `fill_buf` will be needed to read the entire content.
484
+ #[ inline]
485
+ fn fill_buf ( & mut self ) -> io:: Result < & [ u8 ] > {
486
+ let ( front, _) = self . as_slices ( ) ;
487
+ Ok ( front)
488
+ }
489
+
490
+ #[ inline]
491
+ fn consume ( & mut self , amt : usize ) {
492
+ self . drain ( ..amt) ;
493
+ }
494
+ }
495
+
478
496
/// Write is implemented for `VecDeque<u8>` by appending to the `VecDeque`, growing it as needed.
479
497
#[ stable( feature = "vecdeque_read_write" , since = "1.63.0" ) ]
480
498
impl < A : Allocator > Write for VecDeque < u8 , A > {
Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ export RUSTC_ICE=$TMPDIR
11
11
$RUSTC src/lib.rs -Z treat-err-as-bug=1 1> $TMPDIR /rust-test-default-set.log 2>&1
12
12
default_set=$( cat $TMPDIR /rustc-ice-* .txt | wc -l)
13
13
content=$( cat $TMPDIR /rustc-ice-* .txt)
14
+ # Ensure that the ICE dump path doesn't contain `:` because they cause problems on Windows
15
+ windows_safe=$( echo rustc-ice-* .txt | grep ' :' )
16
+ if [ ! -z " $windows_safe " ]; then
17
+ exit 1
18
+ fi
19
+
14
20
rm $TMPDIR /rustc-ice-* .txt
15
21
RUST_BACKTRACE=short $RUSTC src/lib.rs -Z treat-err-as-bug=1 1> $TMPDIR /rust-test-short.log 2>&1
16
22
short=$( cat $TMPDIR /rustc-ice-* .txt | wc -l)
You can’t perform that action at this time.
0 commit comments