about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-06-08 19:30:33 -0700
committerbors <bors@rust-lang.org>2016-06-08 19:30:33 -0700
commitbb4b3fb7f97924919f072ec9a360bdf943218dbf (patch)
tree3765d3082b94546c8ea1b23ae75e12aa7b43924b /src/libstd/sync
parent34505e22289d3b2416ab0922131e8526d0d5cc0b (diff)
parent2de6ea7a35fb53ce5e4a7e5541a2adf425b7da23 (diff)
downloadrust-bb4b3fb7f97924919f072ec9a360bdf943218dbf.tar.gz
rust-bb4b3fb7f97924919f072ec9a360bdf943218dbf.zip
Auto merge of #32202 - arielb1:slice-patterns, r=nikomatsakis
Implement RFC495 semantics for slice patterns

non-MIR translation is still not supported for these and will happily ICE.

This is a [breaking-change] for many uses of slice_patterns.

[RFC 495 text](https://github.com/rust-lang/rfcs/blob/master/text/0495-array-pattern-changes.md)
Diffstat (limited to 'src/libstd/sync')
-rw-r--r--src/libstd/sync/mpsc/spsc_queue.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libstd/sync/mpsc/spsc_queue.rs b/src/libstd/sync/mpsc/spsc_queue.rs
index ffd33f8518f..02506e7c2f3 100644
--- a/src/libstd/sync/mpsc/spsc_queue.rs
+++ b/src/libstd/sync/mpsc/spsc_queue.rs
@@ -265,15 +265,18 @@ mod tests {
 
             // Ensure the borrowchecker works
             match queue.peek() {
-                Some(vec) => match &**vec {
-                    // Note that `pop` is not allowed here due to borrow
-                    [1] => {}
-                    _ => return
+                Some(vec) => {
+                    assert_eq!(&*vec, &[1]);
                 },
                 None => unreachable!()
             }
 
-            queue.pop();
+            match queue.pop() {
+                Some(vec) => {
+                    assert_eq!(&*vec, &[1]);
+                },
+                None => unreachable!()
+            }
         }
     }