Skip to content

Commit

Permalink
Switch to rust 1.37.0 (#8192)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuhood committed Aug 22, 2019
1 parent 7346b0b commit e1667ed
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion rust-toolchain
@@ -1 +1 @@
1.36.0
1.37.0
2 changes: 1 addition & 1 deletion src/rust/engine/fs/src/lib.rs
Expand Up @@ -627,7 +627,7 @@ impl PosixFS {
.read_dir()?
.map(|readdir| {
let dir_entry = readdir?;
let (file_type, compute_metadata): (_, Box<FnOnce() -> Result<_, _>>) =
let (file_type, compute_metadata): (_, Box<dyn FnOnce() -> Result<_, _>>) =
match self.symlink_behavior {
SymlinkBehavior::Aware => {
// Use the dir_entry metadata, which is symlink aware.
Expand Down
8 changes: 4 additions & 4 deletions src/rust/engine/fs/store/src/snapshot.rs
Expand Up @@ -407,10 +407,10 @@ impl Snapshot {
let files: Vec<_> = dir.get_files().iter().map(|file| file.get_name().to_owned()).collect();

match (saw_matching_dir, extra_directories.is_empty() && files.is_empty()) {
(false, true) => return futures::future::ok(futures::future::Loop::Break(bazel_protos::remote_execution::Directory::new())).to_boxed(),
(false, true) => futures::future::ok(futures::future::Loop::Break(bazel_protos::remote_execution::Directory::new())).to_boxed(),
(false, false) => {
// Prefer "No subdirectory found" error to "had extra files" error.
return futures::future::err(format!(
futures::future::err(format!(
"Cannot strip prefix {} from root directory {:?} - {}directory{} didn't contain a directory named {}{}",
already_stripped.join(&prefix).display(),
root_digest,
Expand All @@ -421,14 +421,14 @@ impl Snapshot {
)).to_boxed()
},
(true, false) => {
return futures::future::err(format!(
futures::future::err(format!(
"Cannot strip prefix {} from root directory {:?} - {}directory{} contained non-matching {}",
already_stripped.join(&prefix).display(),
root_digest,
if has_already_stripped_any { "sub" } else { "root " },
if has_already_stripped_any { format!(" {}", already_stripped.display()) } else { String::new() },
Self::directories_and_files(&extra_directories, &files),
)).to_boxed();
)).to_boxed()
},
(true, true) => {
// Must be 0th index, because we've checked that we saw a matching directory, and no others.
Expand Down
2 changes: 1 addition & 1 deletion src/rust/engine/process_execution/src/speculate.rs
Expand Up @@ -155,7 +155,7 @@ mod tests {
is_err: bool,
call_counter: Arc<Mutex<u32>>,
) -> DelayedCommandRunner {
let mut result;
let result;
if is_err {
result = Err(msg.into());
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/rust/engine/serverset/src/lib.rs
Expand Up @@ -92,7 +92,7 @@ struct Inner<T: Clone> {
// connection will be used.
next_connection: usize,

connect: Box<Fn(&str) -> T + 'static + Send>,
connect: Box<dyn Fn(&str) -> T + 'static + Send>,

connection_limit: usize,

Expand Down Expand Up @@ -532,7 +532,7 @@ mod tests {
let start = std::time::Instant::now();

// This should take at least 20ms because both servers are marked as unhealthy.
runtime.block_on(s.next()).unwrap();
let _ = runtime.block_on(s.next()).unwrap();

// Make sure we waited for at least 10ms; we should have waited 20ms, but it may have taken a
// little time to mark a server as unhealthy, so we have some padding between what we expect
Expand Down

0 comments on commit e1667ed

Please sign in to comment.