File tree 1 file changed +0
-21
lines changed
1 file changed +0
-21
lines changed Original file line number Diff line number Diff line change @@ -315,27 +315,6 @@ mod test {
315
315
assert_eq ! ( consumer. pop( ) , None ) ;
316
316
}
317
317
318
- // This behaviour is blocked by the type system if using the safe constructor
319
- #[ test]
320
- fn pop_peeked_unchecked ( ) {
321
- let q = unsafe { Queue :: new ( 0 ) } ;
322
- q. push ( vec ! [ 1 i] ) ;
323
- q. push ( vec ! [ 2 ] ) ;
324
- let peeked = q. peek ( ) . unwrap ( ) ;
325
-
326
- assert_eq ! ( * peeked, vec![ 1 ] ) ;
327
- assert_eq ! ( q. pop( ) , Some ( vec![ 1 ] ) ) ;
328
-
329
- assert_eq ! ( * peeked, vec![ 1 ] ) ;
330
- q. push ( vec ! [ 7 ] ) ;
331
-
332
- // Note: This should actually expect 1, but this test is to highlight
333
- // the unsafety allowed by the unchecked usage. A Rust user would not
334
- // expect their peeked value to mutate like this without the type system
335
- // complaining.
336
- assert_eq ! ( * peeked, vec![ 7 ] ) ;
337
- }
338
-
339
318
#[ test]
340
319
fn peek ( ) {
341
320
let ( mut consumer, mut producer) = queue ( 0 ) ;
You can’t perform that action at this time.
0 commit comments