summary refs log tree commit diff
path: root/devices/src
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@chromium.org>2018-12-12 14:33:42 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-12-13 19:28:04 -0800
commit2bac1e7a9c710d6ad3e50a10463f758a1b5db40a (patch)
treefefb6ff3f38f84698b5e558f2692af15793bdde0 /devices/src
parent3397126b3c862fbd58c7fd31e90eb64c524d27ec (diff)
downloadcrosvm-2bac1e7a9c710d6ad3e50a10463f758a1b5db40a.tar
crosvm-2bac1e7a9c710d6ad3e50a10463f758a1b5db40a.tar.gz
crosvm-2bac1e7a9c710d6ad3e50a10463f758a1b5db40a.tar.bz2
crosvm-2bac1e7a9c710d6ad3e50a10463f758a1b5db40a.tar.lz
crosvm-2bac1e7a9c710d6ad3e50a10463f758a1b5db40a.tar.xz
crosvm-2bac1e7a9c710d6ad3e50a10463f758a1b5db40a.tar.zst
crosvm-2bac1e7a9c710d6ad3e50a10463f758a1b5db40a.zip
toolchain: Update to Rust 1.31.0
We updated the production toolchain from 1.30 to 1.31 in CL:1366446.
This CL does the same upgrade for the local developer toolchain and
Kokoro.

The relevant changes are in rust-toolchain and kokoro/Dockerfile.
The rest are from rustfmt.

TEST=cargo fmt --all -- --check
TEST=as described in kokoro/README.md

Change-Id: I3b4913f3e237baa36c664b4953be360c09efffd4
Reviewed-on: https://chromium-review.googlesource.com/1374376
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Diffstat (limited to 'devices/src')
-rw-r--r--devices/src/bus.rs6
-rw-r--r--devices/src/virtio/balloon.rs6
-rw-r--r--devices/src/virtio/block.rs3
-rw-r--r--devices/src/virtio/gpu/mod.rs9
-rw-r--r--devices/src/virtio/net.rs6
-rw-r--r--devices/src/virtio/p9.rs3
-rw-r--r--devices/src/virtio/rng.rs6
-rw-r--r--devices/src/virtio/vhost/net.rs6
-rw-r--r--devices/src/virtio/vhost/worker.rs6
-rw-r--r--devices/src/virtio/virtio_pci_common_config.rs12
-rw-r--r--devices/src/virtio/virtio_pci_device.rs3
-rw-r--r--devices/src/virtio/wl.rs6
12 files changed, 46 insertions, 26 deletions
diff --git a/devices/src/bus.rs b/devices/src/bus.rs
index 8bee1d0..8124d87 100644
--- a/devices/src/bus.rs
+++ b/devices/src/bus.rs
@@ -111,7 +111,8 @@ impl Bus {
                     len: 1,
                     full_addr: false,
                 },
-            ).rev()
+            )
+            .rev()
             .next()?;
         Some((*range, dev))
     }
@@ -160,7 +161,8 @@ impl Bus {
                     full_addr,
                 },
                 device,
-            ).is_some()
+            )
+            .is_some()
         {
             return Err(Error::Overlap);
         }
diff --git a/devices/src/virtio/balloon.rs b/devices/src/virtio/balloon.rs
index c7614c4..d67c532 100644
--- a/devices/src/virtio/balloon.rs
+++ b/devices/src/virtio/balloon.rs
@@ -139,10 +139,12 @@ impl Worker {
             .and_then(|pc| {
                 pc.add(&self.command_socket, Token::CommandSocket)
                     .and(Ok(pc))
-            }).and_then(|pc| {
+            })
+            .and_then(|pc| {
                 pc.add(&self.interrupt_resample_evt, Token::InterruptResample)
                     .and(Ok(pc))
-            }).and_then(|pc| pc.add(&kill_evt, Token::Kill).and(Ok(pc)))
+            })
+            .and_then(|pc| pc.add(&kill_evt, Token::Kill).and(Ok(pc)))
         {
             Ok(pc) => pc,
             Err(e) => {
diff --git a/devices/src/virtio/block.rs b/devices/src/virtio/block.rs
index f817e89..0371809 100644
--- a/devices/src/virtio/block.rs
+++ b/devices/src/virtio/block.rs
@@ -558,7 +558,8 @@ impl<T: DiskFile> Worker<T> {
             .and_then(|pc| {
                 pc.add(&self.interrupt_resample_evt, Token::InterruptResample)
                     .and(Ok(pc))
-            }).and_then(|pc| pc.add(&kill_evt, Token::Kill).and(Ok(pc)))
+            })
+            .and_then(|pc| pc.add(&kill_evt, Token::Kill).and(Ok(pc)))
         {
             Ok(pc) => pc,
             Err(e) => {
diff --git a/devices/src/virtio/gpu/mod.rs b/devices/src/virtio/gpu/mod.rs
index bcab27e..f2b7f12 100644
--- a/devices/src/virtio/gpu/mod.rs
+++ b/devices/src/virtio/gpu/mod.rs
@@ -496,10 +496,12 @@ impl Worker {
             .and_then(|pc| {
                 pc.add(&*self.state.display().borrow(), Token::Display)
                     .and(Ok(pc))
-            }).and_then(|pc| {
+            })
+            .and_then(|pc| {
                 pc.add(&self.interrupt_resample_evt, Token::InterruptResample)
                     .and(Ok(pc))
-            }).and_then(|pc| pc.add(&self.kill_evt, Token::Kill).and(Ok(pc)))
+            })
+            .and_then(|pc| pc.add(&self.kill_evt, Token::Kill).and(Ok(pc)))
         {
             Ok(pc) => pc,
             Err(e) => {
@@ -779,7 +781,8 @@ impl VirtioDevice for Gpu {
                 resource_bridge,
                 kill_evt,
                 state: Frontend::new(Backend::new(device, display, renderer)),
-            }.run()
+            }
+            .run()
         });
     }
 }
diff --git a/devices/src/virtio/net.rs b/devices/src/virtio/net.rs
index 8fa4d8d..dd8afd9 100644
--- a/devices/src/virtio/net.rs
+++ b/devices/src/virtio/net.rs
@@ -241,7 +241,8 @@ where
             .and_then(|pc| {
                 pc.add(&self.interrupt_resample_evt, Token::InterruptResample)
                     .and(Ok(pc))
-            }).and_then(|pc| pc.add(&kill_evt, Token::Kill).and(Ok(pc)))
+            })
+            .and_then(|pc| pc.add(&kill_evt, Token::Kill).and(Ok(pc)))
             .map_err(NetError::CreatePollContext)?;
 
         'poll: loop {
@@ -320,7 +321,8 @@ where
         // changes to this set, also change the corresponding feature set in vm_concierge.
         tap.set_offload(
             net_sys::TUN_F_CSUM | net_sys::TUN_F_UFO | net_sys::TUN_F_TSO4 | net_sys::TUN_F_TSO6,
-        ).map_err(NetError::TapSetOffload)?;
+        )
+        .map_err(NetError::TapSetOffload)?;
 
         let vnet_hdr_size = mem::size_of::<virtio_net_hdr_v1>() as i32;
         tap.set_vnet_hdr_size(vnet_hdr_size)
diff --git a/devices/src/virtio/p9.rs b/devices/src/virtio/p9.rs
index 2c1faa6..e9bdbb7 100644
--- a/devices/src/virtio/p9.rs
+++ b/devices/src/virtio/p9.rs
@@ -278,7 +278,8 @@ impl Worker {
             .and_then(|pc| {
                 pc.add(&self.interrupt_resample_evt, Token::InterruptResample)
                     .and(Ok(pc))
-            }).and_then(|pc| pc.add(&kill_evt, Token::Kill).and(Ok(pc)))
+            })
+            .and_then(|pc| pc.add(&kill_evt, Token::Kill).and(Ok(pc)))
             .map_err(P9Error::CreatePollContext)?;
 
         loop {
diff --git a/devices/src/virtio/rng.rs b/devices/src/virtio/rng.rs
index ee83980..96d0d4f 100644
--- a/devices/src/virtio/rng.rs
+++ b/devices/src/virtio/rng.rs
@@ -51,7 +51,8 @@ impl Worker {
                         avail_desc.addr,
                         &mut self.random_file,
                         avail_desc.len as usize,
-                    ).is_ok()
+                    )
+                    .is_ok()
                 {
                     len = avail_desc.len;
                 }
@@ -86,7 +87,8 @@ impl Worker {
             .and_then(|pc| {
                 pc.add(&self.interrupt_resample_evt, Token::InterruptResample)
                     .and(Ok(pc))
-            }).and_then(|pc| pc.add(&kill_evt, Token::Kill).and(Ok(pc)))
+            })
+            .and_then(|pc| pc.add(&kill_evt, Token::Kill).and(Ok(pc)))
         {
             Ok(pc) => pc,
             Err(e) => {
diff --git a/devices/src/virtio/vhost/net.rs b/devices/src/virtio/vhost/net.rs
index 2b8c08b..4727bbc 100644
--- a/devices/src/virtio/vhost/net.rs
+++ b/devices/src/virtio/vhost/net.rs
@@ -58,7 +58,8 @@ where
         // Set offload flags to match the virtio features below.
         tap.set_offload(
             net_sys::TUN_F_CSUM | net_sys::TUN_F_UFO | net_sys::TUN_F_TSO4 | net_sys::TUN_F_TSO6,
-        ).map_err(Error::TapSetOffload)?;
+        )
+        .map_err(Error::TapSetOffload)?;
 
         // We declare VIRTIO_NET_F_MRG_RXBUF, so set the vnet hdr size to match.
         let vnet_hdr_size = mem::size_of::<virtio_net::virtio_net_hdr_mrg_rxbuf>() as i32;
@@ -237,7 +238,8 @@ pub mod tests {
             Ipv4Addr::new(255, 255, 255, 0),
             "de:21:e8:47:6b:6a".parse().unwrap(),
             &guest_memory,
-        ).unwrap()
+        )
+        .unwrap()
     }
 
     #[test]
diff --git a/devices/src/virtio/vhost/worker.rs b/devices/src/virtio/vhost/worker.rs
index abd063b..e9ee2fb 100644
--- a/devices/src/virtio/vhost/worker.rs
+++ b/devices/src/virtio/vhost/worker.rs
@@ -97,7 +97,8 @@ impl<T: Vhost> Worker<T> {
                     queue.used_ring,
                     queue.avail_ring,
                     None,
-                ).map_err(Error::VhostSetVringAddr)?;
+                )
+                .map_err(Error::VhostSetVringAddr)?;
             self.vhost_handle
                 .set_vring_base(queue_index, 0)
                 .map_err(Error::VhostSetVringBase)?;
@@ -123,7 +124,8 @@ impl<T: Vhost> Worker<T> {
             .and_then(|pc| {
                 pc.add(&self.interrupt_resample_evt, Token::InterruptResample)
                     .and(Ok(pc))
-            }).and_then(|pc| pc.add(&kill_evt, Token::Kill).and(Ok(pc)))
+            })
+            .and_then(|pc| pc.add(&kill_evt, Token::Kill).and(Ok(pc)))
             .map_err(Error::CreatePollContext)?;
 
         'poll: loop {
diff --git a/devices/src/virtio/virtio_pci_common_config.rs b/devices/src/virtio/virtio_pci_common_config.rs
index 4f30b3d..fb428dd 100644
--- a/devices/src/virtio/virtio_pci_common_config.rs
+++ b/devices/src/virtio/virtio_pci_common_config.rs
@@ -108,11 +108,13 @@ impl VirtioPciCommonConfig {
             0x12 => queues.len() as u16, // num_queues
             0x16 => self.queue_select,
             0x18 => self.with_queue(queues, |q| q.size).unwrap_or(0),
-            0x1c => if self.with_queue(queues, |q| q.ready).unwrap_or(false) {
-                1
-            } else {
-                0
-            },
+            0x1c => {
+                if self.with_queue(queues, |q| q.ready).unwrap_or(false) {
+                    1
+                } else {
+                    0
+                }
+            }
             0x1e => self.queue_select, // notify_off
             _ => 0,
         }
diff --git a/devices/src/virtio/virtio_pci_device.rs b/devices/src/virtio/virtio_pci_device.rs
index c362477..6a9ca5e 100644
--- a/devices/src/virtio/virtio_pci_device.rs
+++ b/devices/src/virtio/virtio_pci_device.rs
@@ -333,7 +333,8 @@ impl PciDevice for VirtioPciDevice {
                     notify_base + i as u64 * NOTIFY_OFF_MULTIPLIER as u64,
                     Datamatch::U16(Some(i as u16)),
                 )
-            }).collect()
+            })
+            .collect()
     }
 
     fn config_registers(&self) -> &PciConfiguration {
diff --git a/devices/src/virtio/wl.rs b/devices/src/virtio/wl.rs
index 9c3b517..2be0d7e 100644
--- a/devices/src/virtio/wl.rs
+++ b/devices/src/virtio/wl.rs
@@ -1256,8 +1256,7 @@ impl WlState {
                     }
                 },
                 #[cfg(feature = "gpu")]
-                VIRTIO_WL_CTRL_VFD_SEND_KIND_VIRTGPU if self.resource_bridge.is_some() =>
-                {
+                VIRTIO_WL_CTRL_VFD_SEND_KIND_VIRTGPU if self.resource_bridge.is_some() => {
                     if let Err(e) = self
                         .resource_bridge
                         .as_ref()
@@ -1779,7 +1778,8 @@ impl VirtioDevice for Wl {
                             vm_socket,
                             use_transition_flags,
                             resource_bridge,
-                        ).run(queue_evts, kill_evt);
+                        )
+                        .run(queue_evts, kill_evt);
                     });
 
             if let Err(e) = worker_result {