summary refs log tree commit diff
path: root/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 /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 'src')
-rw-r--r--src/linux.rs18
-rw-r--r--src/main.rs27
-rw-r--r--src/plugin/mod.rs6
3 files changed, 29 insertions, 22 deletions
diff --git a/src/linux.rs b/src/linux.rs
index 1cb99cc..7d9fa1b 100644
--- a/src/linux.rs
+++ b/src/linux.rs
@@ -356,7 +356,8 @@ fn create_virtio_devs(
                             netmask,
                             mac_address,
                             &mem,
-                        ).map_err(Error::VhostNetDeviceNew)?,
+                        )
+                        .map_err(Error::VhostNetDeviceNew)?,
                     )
                 } else {
                     Box::new(
@@ -418,7 +419,8 @@ fn create_virtio_devs(
                         "tmpfs",
                         (libc::MS_NOSUID | libc::MS_NODEV | libc::MS_NOEXEC) as usize,
                         "size=67108864",
-                    ).unwrap();
+                    )
+                    .unwrap();
 
                     // Device nodes required for DRM.
                     let sys_dev_char_path = Path::new("/sys/dev/char");
@@ -496,7 +498,8 @@ fn create_virtio_devs(
                 },
                 wayland_device_socket,
                 resource_bridge_wl_socket,
-            ).map_err(Error::WaylandDeviceNew)?,
+            )
+            .map_err(Error::WaylandDeviceNew)?,
         );
 
         let jail = if cfg.multiprocess {
@@ -511,7 +514,8 @@ fn create_virtio_devs(
                 "tmpfs",
                 (libc::MS_NOSUID | libc::MS_NODEV | libc::MS_NOEXEC) as usize,
                 "size=67108864",
-            ).unwrap();
+            )
+            .unwrap();
 
             // Bind mount the wayland socket's directory into jail's root. This is necessary since
             // each new wayland context must open() the socket. If the wayland socket is ever
@@ -738,7 +742,8 @@ fn run_vcpu(
             exit_evt
                 .write(1)
                 .expect("failed to signal vcpu exit eventfd");
-        }).map_err(Error::SpawnVcpu)
+        })
+        .map_err(Error::SpawnVcpu)
 }
 
 // Reads the contents of a file and converts them into a u64.
@@ -797,7 +802,8 @@ pub fn run_config(cfg: Config) -> Result<()> {
 
     let linux = Arch::build_vm(components, |m, e| {
         create_virtio_devs(cfg, m, e, wayland_device_socket, balloon_device_socket)
-    }).map_err(Error::BuildingVm)?;
+    })
+    .map_err(Error::BuildingVm)?;
     run_control(linux, control_sockets, balloon_host_socket, sigchld_fd)
 }
 
diff --git a/src/main.rs b/src/main.rs
index a492437..d901cbf 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -350,7 +350,8 @@ fn set_argument(cfg: &mut Config, name: &str, value: Option<&str>) -> argument::
                 .ok_or_else(|| argument::Error::InvalidValue {
                     value: param.to_owned(),
                     expected: "missing tag for `shared-dir`",
-                })?.to_owned();
+                })?
+                .to_owned();
 
             if !src.is_dir() {
                 return Err(argument::Error::InvalidValue {
@@ -466,7 +467,8 @@ fn run_vm(args: std::env::Args) -> std::result::Result<(), ()> {
     let mut cfg = Config::default();
     let match_res = set_arguments(args, &arguments[..], |name, value| {
         set_argument(&mut cfg, name, value)
-    }).and_then(|_| {
+    })
+    .and_then(|_| {
         if cfg.kernel_path.as_os_str().is_empty() && cfg.plugin.is_none() {
             return Err(argument::Error::ExpectedArgument("`KERNEL`".to_owned()));
         }
@@ -505,19 +507,16 @@ fn run_vm(args: std::env::Args) -> std::result::Result<(), ()> {
 
     match match_res {
         #[cfg(feature = "plugin")]
-        Ok(()) if cfg.plugin.is_some() =>
-        {
-            match plugin::run_config(cfg) {
-                Ok(_) => {
-                    info!("crosvm and plugin have exited normally");
-                    Ok(())
-                }
-                Err(e) => {
-                    error!("{}", e);
-                    Err(())
-                }
+        Ok(()) if cfg.plugin.is_some() => match plugin::run_config(cfg) {
+            Ok(_) => {
+                info!("crosvm and plugin have exited normally");
+                Ok(())
             }
-        }
+            Err(e) => {
+                error!("{}", e);
+                Err(())
+            }
+        },
         Ok(()) => match linux::run_config(cfg) {
             Ok(_) => {
                 info!("crosvm has exited normally");
diff --git a/src/plugin/mod.rs b/src/plugin/mod.rs
index 745fa4e..0aa2ff4 100644
--- a/src/plugin/mod.rs
+++ b/src/plugin/mod.rs
@@ -254,7 +254,8 @@ fn create_plugin_jail(root: &Path, seccomp_policy: &Path) -> Result<Minijail> {
         "tmpfs",
         (MS_NOSUID | MS_NODEV) as usize,
         "size=67108864",
-    ).map_err(Error::MountRoot)?;
+    )
+    .map_err(Error::MountRoot)?;
 
     Ok(j)
 }
@@ -439,7 +440,8 @@ pub fn run_vcpus(
                     vcpu_exit_evt
                         .write(1)
                         .expect("failed to signal vcpu exit eventfd");
-                }).map_err(Error::SpawnVcpu)?,
+                })
+                .map_err(Error::SpawnVcpu)?,
         );
     }
     Ok(())