about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2020-04-16 12:44:57 -0700
committerJosh Stone <jistone@redhat.com>2020-04-16 12:44:57 -0700
commit2edd123a233fff2fbccd17299e0c14d2203e1acc (patch)
tree0a17e3a35ef2901f28cc637693889a057f77910f /src/libstd
parent7fb5187d0423f4cd0441526571b8cd61927123c9 (diff)
downloadrust-2edd123a233fff2fbccd17299e0c14d2203e1acc.tar.gz
rust-2edd123a233fff2fbccd17299e0c14d2203e1acc.zip
Dogfood or_patterns in the standard library
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/lib.rs1
-rw-r--r--src/libstd/sync/mpsc/oneshot.rs2
-rw-r--r--src/libstd/sync/mpsc/stream.rs2
3 files changed, 3 insertions, 2 deletions
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index a9a519f0a3a..59d845c619b 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -285,6 +285,7 @@
 #![feature(never_type)]
 #![feature(nll)]
 #![feature(optin_builtin_traits)]
+#![feature(or_patterns)]
 #![feature(panic_info_message)]
 #![feature(panic_internals)]
 #![feature(panic_unwind)]
diff --git a/src/libstd/sync/mpsc/oneshot.rs b/src/libstd/sync/mpsc/oneshot.rs
index 5b41525e06a..75f5621fa12 100644
--- a/src/libstd/sync/mpsc/oneshot.rs
+++ b/src/libstd/sync/mpsc/oneshot.rs
@@ -260,7 +260,7 @@ impl<T> Packet<T> {
         let state = match self.state.load(Ordering::SeqCst) {
             // Each of these states means that no further activity will happen
             // with regard to abortion selection
-            s @ EMPTY | s @ DATA | s @ DISCONNECTED => s,
+            s @ (EMPTY | DATA | DISCONNECTED) => s,
 
             // If we've got a blocked thread, then use an atomic to gain ownership
             // of it (may fail)
diff --git a/src/libstd/sync/mpsc/stream.rs b/src/libstd/sync/mpsc/stream.rs
index f33493ee0c9..26b4faebd86 100644
--- a/src/libstd/sync/mpsc/stream.rs
+++ b/src/libstd/sync/mpsc/stream.rs
@@ -205,7 +205,7 @@ impl<T> Packet<T> {
             // Messages which actually popped from the queue shouldn't count as
             // a steal, so offset the decrement here (we already have our
             // "steal" factored into the channel count above).
-            data @ Ok(..) | data @ Err(Upgraded(..)) => unsafe {
+            data @ (Ok(..) | Err(Upgraded(..))) => unsafe {
                 *self.queue.consumer_addition().steals.get() -= 1;
                 data
             },