Skip to content

Commit

Permalink
upgrade to Rust v1.66.0 (pantsbuild#17893)
Browse files Browse the repository at this point in the history
Upgrade to Rust v1.66.0.  [Announcement](https://blog.rust-lang.org/2022/12/15/Rust-1.66.0.html)
  • Loading branch information
tdyas authored Dec 29, 2022
1 parent eecdd6c commit babf5db
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: actions/cache@v3
with:
key: Linux-x86_64-rustup-${{ hashFiles('rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.65.0-*
path: '~/.rustup/toolchains/1.66.0-*
~/.rustup/update-hashes
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
uses: actions/cache@v3
with:
key: macOS11-x86_64-rustup-${{ hashFiles('rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.65.0-*
path: '~/.rustup/toolchains/1.66.0-*
~/.rustup/update-hashes
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: actions/cache@v3
with:
key: Linux-x86_64-rustup-${{ hashFiles('rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.65.0-*
path: '~/.rustup/toolchains/1.66.0-*
~/.rustup/update-hashes
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
uses: actions/cache@v3
with:
key: macOS11-x86_64-rustup-${{ hashFiles('rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.65.0-*
path: '~/.rustup/toolchains/1.66.0-*
~/.rustup/update-hashes
Expand Down Expand Up @@ -314,7 +314,7 @@ jobs:
uses: actions/cache@v3
with:
key: macOS10-15-x86_64-rustup-${{ hashFiles('rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.65.0-*
path: '~/.rustup/toolchains/1.66.0-*
~/.rustup/update-hashes
Expand Down Expand Up @@ -381,7 +381,7 @@ jobs:
uses: actions/cache@v3
with:
key: macOS11-ARM64-rustup-${{ hashFiles('rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.65.0-*
path: '~/.rustup/toolchains/1.66.0-*
~/.rustup/update-hashes
Expand Down Expand Up @@ -445,7 +445,7 @@ jobs:
uses: actions/cache@v3
with:
key: macOS11-x86_64-rustup-${{ hashFiles('rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.65.0-*
path: '~/.rustup/toolchains/1.66.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.65.0"
channel = "1.66.0"
components = [
"cargo",
"clippy",
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 @@ -862,7 +862,7 @@ impl Store {
)
.await?;

let ingested_file_sizes = ingested_digests.iter().map(|(digest, _)| digest.size_bytes);
let ingested_file_sizes = ingested_digests.keys().map(|digest| digest.size_bytes);
let uploaded_file_sizes = digests_to_upload.iter().map(|digest| digest.size_bytes);

Ok(UploadSummary {
Expand Down
2 changes: 1 addition & 1 deletion src/rust/engine/process_execution/src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ impl<'a> CapturedWorkdir for CommandRunner<'a> {

let working_dir = req
.working_directory
.map(|relpath| Path::new(&sandbox_path_in_container).join(&relpath))
.map(|relpath| Path::new(&sandbox_path_in_container).join(relpath))
.unwrap_or_else(|| Path::new(&sandbox_path_in_container).to_path_buf())
.into_os_string()
.into_string()
Expand Down
4 changes: 2 additions & 2 deletions src/rust/engine/process_execution/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ pub fn setup_run_sh_script(
} else {
workdir_path.to_owned()
};
let quoted_cwd = bash::escape(&cwd);
let quoted_cwd = bash::escape(cwd);
str::from_utf8(&quoted_cwd)
.map_err(|e| format!("{:?}", e))?
.to_string()
Expand All @@ -909,7 +909,7 @@ cd {}
.create_new(true)
.write(true)
.mode(USER_EXECUTABLE_MODE) // Executable for user, read-only for others.
.open(&full_file_path)
.open(full_file_path)
.map_err(|e| format!("{:?}", e))?
.write_all(full_script.as_bytes())
.map_err(|e| format!("{:?}", e))
Expand Down
2 changes: 1 addition & 1 deletion src/rust/engine/process_execution/src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,7 @@ pub fn extract_output_files(
// method.
if treat_tree_digest_as_final_directory_hack {
match &action_result.output_directories[..] {
&[ref directory] => {
[directory] => {
match require_digest(directory.tree_digest.as_ref()) {
Ok(digest) => {
return future::ready::<Result<_, StoreError>>(Ok(
Expand Down
4 changes: 2 additions & 2 deletions src/rust/engine/rule_graph/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,8 @@ impl<R: Rule> Builder<R> {
#[allow(clippy::type_complexity)]
let dependencies_by_key: Vec<Vec<(DependencyKey<R::TypeId>, NodeIndex<u32>)>> =
Self::edges_by_dependency_key(&graph, node_id, false)
.into_iter()
.map(|(_, edge_refs)| {
.into_values()
.map(|edge_refs| {
edge_refs
.iter()
.map(|edge_ref| (edge_ref.weight().0.clone(), edge_ref.target()))
Expand Down
2 changes: 1 addition & 1 deletion src/rust/engine/src/externs/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl PyStdioRead {

fn readinto(&self, obj: &PyAny, py: Python) -> PyResult<usize> {
let py_buffer = PyBuffer::get(obj)?;
let mut buffer = vec![0; py_buffer.len_bytes() as usize];
let mut buffer = vec![0; py_buffer.len_bytes()];
let read = py
.allow_threads(|| stdio::get_destination().read_stdin(&mut buffer))
.map_err(|e| PyException::new_err(e.to_string()))?;
Expand Down
2 changes: 1 addition & 1 deletion src/rust/engine/testutil/mock/src/cas_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ impl StubCASResponder {
match maybe_bytes {
Some(bytes) => Ok(
bytes
.chunks(self.chunk_size_bytes as usize)
.chunks(self.chunk_size_bytes)
.map(|b| ReadResponse {
data: bytes.slice_ref(b),
})
Expand Down
2 changes: 1 addition & 1 deletion src/rust/engine/workunit_store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl SpanId {

impl std::fmt::Display for SpanId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:016.x}", self.0)
write!(f, "{:016x}", self.0)
}
}

Expand Down

0 comments on commit babf5db

Please sign in to comment.