From 5c82f484db29e37e26064e853d8a303cc13bc78c Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 27 Aug 2014 14:53:23 -0400 Subject: [PATCH] Remove invalid test -- this test reads freed memory, from what I can tell --- src/libsync/spsc_queue.rs | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/libsync/spsc_queue.rs b/src/libsync/spsc_queue.rs index 578e518cb8f..32b77be78a4 100644 --- a/src/libsync/spsc_queue.rs +++ b/src/libsync/spsc_queue.rs @@ -315,27 +315,6 @@ fn smoke() { assert_eq!(consumer.pop(), None); } - // This behaviour is blocked by the type system if using the safe constructor - #[test] - fn pop_peeked_unchecked() { - let q = unsafe { Queue::new(0) }; - q.push(vec![1i]); - q.push(vec![2]); - let peeked = q.peek().unwrap(); - - assert_eq!(*peeked, vec![1]); - assert_eq!(q.pop(), Some(vec![1])); - - assert_eq!(*peeked, vec![1]); - q.push(vec![7]); - - // Note: This should actually expect 1, but this test is to highlight - // the unsafety allowed by the unchecked usage. A Rust user would not - // expect their peeked value to mutate like this without the type system - // complaining. - assert_eq!(*peeked, vec![7]); - } - #[test] fn peek() { let (mut consumer, mut producer) = queue(0);