]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/sync/mpsc/select.rs
Auto merge of #43710 - zackmdavis:field_init_shorthand_power_slam, r=Mark-Simulacrum
[rust.git] / src / libstd / sync / mpsc / select.rs
index 3058282edf33770507c1da65d758611ac39da3e8..e49f4cff024034488d44f156be95143366cf5ea3 100644 (file)
@@ -148,12 +148,12 @@ pub fn handle<'a, T: Send>(&'a self, rx: &'a Receiver<T>) -> Handle<'a, T> {
         let id = self.next_id.get();
         self.next_id.set(id + 1);
         Handle {
-            id: id,
+            id,
             selector: self.inner.get(),
             next: ptr::null_mut(),
             prev: ptr::null_mut(),
             added: false,
-            rx: rx,
+            rx,
             packet: rx,
         }
     }
@@ -352,22 +352,20 @@ fn next(&mut self) -> Option<*mut Handle<'static, ()>> {
     }
 }
 
-#[stable(feature = "mpsc_debug", since = "1.7.0")]
 impl fmt::Debug for Select {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "Select {{ .. }}")
     }
 }
 
-#[stable(feature = "mpsc_debug", since = "1.7.0")]
 impl<'rx, T:Send+'rx> fmt::Debug for Handle<'rx, T> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "Handle {{ .. }}")
     }
 }
 
-#[cfg(test)]
 #[allow(unused_imports)]
+#[cfg(all(test, not(target_os = "emscripten")))]
 mod tests {
     use thread;
     use sync::mpsc::*;
@@ -444,7 +442,6 @@ fn closed() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn unblocks() {
         let (tx1, rx1) = channel::<i32>();
         let (_tx2, rx2) = channel::<i32>();
@@ -469,7 +466,6 @@ fn unblocks() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn both_ready() {
         let (tx1, rx1) = channel::<i32>();
         let (tx2, rx2) = channel::<i32>();
@@ -496,7 +492,6 @@ fn both_ready() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn stress() {
         const AMT: i32 = 10000;
         let (tx1, rx1) = channel::<i32>();
@@ -524,7 +519,6 @@ fn stress() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn cloning() {
         let (tx1, rx1) = channel::<i32>();
         let (_tx2, rx2) = channel::<i32>();
@@ -547,7 +541,6 @@ fn cloning() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn cloning2() {
         let (tx1, rx1) = channel::<i32>();
         let (_tx2, rx2) = channel::<i32>();
@@ -570,7 +563,6 @@ fn cloning2() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn cloning3() {
         let (tx1, rx1) = channel::<()>();
         let (tx2, rx2) = channel::<()>();
@@ -688,7 +680,6 @@ fn preflight9() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn oneshot_data_waiting() {
         let (tx1, rx1) = channel();
         let (tx2, rx2) = channel();
@@ -705,7 +696,6 @@ fn oneshot_data_waiting() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn stream_data_waiting() {
         let (tx1, rx1) = channel();
         let (tx2, rx2) = channel();
@@ -726,7 +716,6 @@ fn stream_data_waiting() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn shared_data_waiting() {
         let (tx1, rx1) = channel();
         let (tx2, rx2) = channel();
@@ -755,7 +744,6 @@ fn sync1() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn sync2() {
         let (tx, rx) = sync_channel::<i32>(0);
         let _t = thread::spawn(move|| {
@@ -768,7 +756,6 @@ fn sync2() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn sync3() {
         let (tx1, rx1) = sync_channel::<i32>(0);
         let (tx2, rx2): (Sender<i32>, Receiver<i32>) = channel();