Skip to content

Commit

Permalink
[internal] upgrade to rust v1.57.0 (pantsbuild#13807)
Browse files Browse the repository at this point in the history
Upgrade to Rust v1.57.0. 

Lints: Had to fix `clippy` pointing out a few struct fields that were unread. Some like the Tokio runtime in Executor probably do need to be stored so I prefixed them all with underscore.

- [v1.57.0 blog post](https://blog.rust-lang.org/2021/12/02/Rust-1.57.0.html)
  • Loading branch information
Tom Dyas authored Dec 5, 2021
1 parent 0bb6655 commit f07db99
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
uses: actions/cache@v2
with:
key: ${{ runner.os }}-rustup-${{ hashFiles('rust-toolchain') }}
path: '~/.rustup/toolchains/1.56.1-*
path: '~/.rustup/toolchains/1.57.0-*
~/.rustup/update-hashes
Expand Down Expand Up @@ -203,7 +203,7 @@ jobs:
uses: actions/cache@v2
with:
key: ${{ runner.os }}-rustup-${{ hashFiles('rust-toolchain') }}
path: '~/.rustup/toolchains/1.56.1-*
path: '~/.rustup/toolchains/1.57.0-*
~/.rustup/update-hashes
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
uses: actions/cache@v2
with:
key: ${{ runner.os }}-rustup-${{ hashFiles('rust-toolchain') }}
path: '~/.rustup/toolchains/1.56.1-*
path: '~/.rustup/toolchains/1.57.0-*
~/.rustup/update-hashes
Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:
uses: actions/cache@v2
with:
key: ${{ runner.os }}-rustup-${{ hashFiles('rust-toolchain') }}
path: '~/.rustup/toolchains/1.56.1-*
path: '~/.rustup/toolchains/1.57.0-*
~/.rustup/update-hashes
Expand Down Expand Up @@ -399,7 +399,7 @@ jobs:
uses: actions/cache@v2
with:
key: ${{ runner.os }}-rustup-${{ hashFiles('rust-toolchain') }}
path: '~/.rustup/toolchains/1.56.1-*
path: '~/.rustup/toolchains/1.57.0-*
~/.rustup/update-hashes
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "1.56.1"
channel = "1.57.0"
components = [
"cargo",
"clippy",
Expand Down
2 changes: 1 addition & 1 deletion src/rust/engine/fs/fs_util/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ async fn execute(top_match: &clap::ArgMatches<'_>) -> Result<(), ExitError> {
.expect("size_bytes must be a non-negative number");
let digest = Digest::new(fingerprint, size_bytes);
let v = match store
.load_file_bytes_with(digest, |bytes| Bytes::copy_from_slice(bytes))
.load_file_bytes_with(digest, Bytes::copy_from_slice)
.await?
{
None => {
Expand Down
2 changes: 1 addition & 1 deletion src/rust/engine/fs/store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ impl Store {
let store = store.clone();
let res = async move {
let maybe_bytes = store
.load_file_bytes_with(file_node_digest, |b| Bytes::copy_from_slice(b))
.load_file_bytes_with(file_node_digest, Bytes::copy_from_slice)
.await?;
maybe_bytes
.ok_or_else(|| format!("Couldn't find file contents for {:?}", path))
Expand Down
8 changes: 4 additions & 4 deletions src/rust/engine/fs/store/src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ use workunit_store::{in_workunit, Metric, ObservationMetric, WorkunitMetadata};
pub struct ByteStore {
instance_name: Option<String>,
chunk_size_bytes: usize,
upload_timeout: Duration,
rpc_attempts: usize,
_upload_timeout: Duration,
_rpc_attempts: usize,
byte_stream_client: Arc<ByteStreamClient<LayeredService>>,
cas_client: Arc<ContentAddressableStorageClient<LayeredService>>,
capabilities_cell: Arc<DoubleCheckedCell<ServerCapabilities>>,
Expand Down Expand Up @@ -103,8 +103,8 @@ impl ByteStore {
Ok(ByteStore {
instance_name,
chunk_size_bytes,
upload_timeout,
rpc_attempts: rpc_retries + 1,
_upload_timeout: upload_timeout,
_rpc_attempts: rpc_retries + 1,
byte_stream_client,
cas_client,
capabilities_cell: capabilities_cell_opt
Expand Down
4 changes: 2 additions & 2 deletions src/rust/engine/process_execution/src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub struct CommandRunner {
metadata: ProcessMetadata,
platform: Platform,
store: Store,
headers: BTreeMap<String, String>,
_headers: BTreeMap<String, String>,
execution_client: Arc<ExecutionClient<LayeredService>>,
action_cache_client: Arc<ActionCacheClient<LayeredService>>,
overall_deadline: Duration,
Expand Down Expand Up @@ -172,7 +172,7 @@ impl CommandRunner {

let command_runner = CommandRunner {
metadata,
headers,
_headers: headers,
execution_client,
action_cache_client,
store,
Expand Down
4 changes: 2 additions & 2 deletions src/rust/engine/process_execution/src/remote_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub struct CommandRunner {
executor: task_executor::Executor,
store: Store,
action_cache_client: Arc<ActionCacheClient<LayeredService>>,
headers: BTreeMap<String, String>,
_headers: BTreeMap<String, String>,
platform: Platform,
cache_read: bool,
cache_write: bool,
Expand Down Expand Up @@ -103,7 +103,7 @@ impl CommandRunner {
executor,
store,
action_cache_client,
headers,
_headers: headers,
platform,
cache_read,
cache_write,
Expand Down
2 changes: 1 addition & 1 deletion src/rust/engine/rule_graph/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ impl<R: Rule> Builder<R> {
.collect::<Vec<_>>(),
dependees_by_out_set
.keys()
.map(|out_set| params_str(out_set))
.map(params_str)
.collect::<Vec<_>>(),
)
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/rust/engine/task_executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ lazy_static! {

#[derive(Debug, Clone)]
pub struct Executor {
runtime: Option<Arc<Runtime>>,
_runtime: Option<Arc<Runtime>>,
handle: Handle,
}

Expand All @@ -56,7 +56,7 @@ impl Executor {
///
pub fn new() -> Executor {
Executor {
runtime: None,
_runtime: None,
handle: Handle::current(),
}
}
Expand All @@ -73,7 +73,7 @@ impl Executor {
let global = GLOBAL_EXECUTOR.load();
if let Some(ref runtime) = *global {
return Ok(Executor {
runtime: Some(runtime.clone()),
_runtime: Some(runtime.clone()),
handle: runtime.handle().clone(),
});
}
Expand Down

0 comments on commit f07db99

Please sign in to comment.