Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade Rust to v1.78.0 #20881

Merged
merged 4 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ jobs:
with:
key: macOS10-15-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain')
}}-v2
path: '~/.rustup/toolchains/1.77.0-*
path: '~/.rustup/toolchains/1.78.0-*

~/.rustup/update-hashes

Expand Down Expand Up @@ -276,7 +276,7 @@ jobs:
with:
key: macOS11-ARM64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain')
}}-v2
path: '~/.rustup/toolchains/1.77.0-*
path: '~/.rustup/toolchains/1.78.0-*

~/.rustup/update-hashes

Expand Down Expand Up @@ -367,7 +367,7 @@ jobs:
uses: actions/cache@v3
with:
key: Linux-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.77.0-*
path: '~/.rustup/toolchains/1.78.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-ARM64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.77.0-*
path: '~/.rustup/toolchains/1.78.0-*

~/.rustup/update-hashes

Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
uses: actions/cache@v3
with:
key: Linux-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.77.0-*
path: '~/.rustup/toolchains/1.78.0-*

~/.rustup/update-hashes

Expand Down Expand Up @@ -232,7 +232,7 @@ jobs:
uses: actions/cache@v3
with:
key: macOS11-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.77.0-*
path: '~/.rustup/toolchains/1.78.0-*

~/.rustup/update-hashes

Expand Down Expand Up @@ -441,7 +441,7 @@ jobs:
uses: actions/cache@v3
with:
key: macOS10-15-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.77.0-*
path: '~/.rustup/toolchains/1.78.0-*

~/.rustup/update-hashes

Expand Down Expand Up @@ -508,7 +508,7 @@ jobs:
uses: actions/cache@v3
with:
key: macOS11-ARM64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.77.0-*
path: '~/.rustup/toolchains/1.78.0-*

~/.rustup/update-hashes

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/rust/engine/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ files(
"**/*.rs",
"!**/*tests.rs",
"**/*.proto",
".cargo/config",
".cargo/config.toml",
],
)

Expand Down
15 changes: 6 additions & 9 deletions src/rust/engine/hashing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,10 @@ impl<AW: ?Sized + AsyncWrite + Unpin> AsyncWrite for WriterHasher<&mut AW> {
/// Copy the data from reader and hash the bytes in one pass.
/// Use hash() to just hash without copying the data anywhere.
///
pub fn sync_copy_and_hash<R: ?Sized, W: ?Sized>(
reader: &mut R,
writer: &mut W,
) -> io::Result<Digest>
pub fn sync_copy_and_hash<R, W>(reader: &mut R, writer: &mut W) -> io::Result<Digest>
where
R: io::Read,
W: io::Write,
R: io::Read + ?Sized,
W: io::Write + ?Sized,
{
let mut hasher = WriterHasher::new(writer);
let _ = io::copy(reader, &mut hasher)?;
Expand All @@ -367,15 +364,15 @@ where
///
/// Copy from reader to writer and return whether the copied data matches expected_digest.
///
pub fn sync_verified_copy<R: ?Sized, W: ?Sized>(
pub fn sync_verified_copy<R, W>(
expected_digest: Digest,
data_is_immutable: bool,
reader: &mut R,
writer: &mut W,
) -> io::Result<bool>
where
R: io::Read,
W: io::Write,
R: io::Read + ?Sized,
W: io::Write + ?Sized,
{
if data_is_immutable {
// Trust that the data hasn't changed, and only validate its length.
Expand Down
2 changes: 1 addition & 1 deletion src/rust/engine/process_execution/remote/src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl CommandRunner {
let capabilities_fut = async {
let mut request = remexec::GetCapabilitiesRequest::default();
if let Some(s) = self.instance_name.as_ref() {
request.instance_name = s.clone();
request.instance_name.clone_from(s);
}

let request = apply_headers(Request::new(request), "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ impl Provider {
let capabilities_fut = async {
let mut request = remexec::GetCapabilitiesRequest::default();
if let Some(s) = self.instance_name.as_ref() {
request.instance_name = s.clone();
request.instance_name.clone_from(s);
}

let mut client = self.capabilities_client.as_ref().clone();
Expand Down
2 changes: 2 additions & 0 deletions src/rust/engine/rule_graph/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,8 @@ impl<R: Rule> Builder<R> {
minimal_in_set.insert(node_id);

// But we ensure that its out_set is accurate before continuing.
// Note: Clippy wants us to use `clone_from`, but doing so fails because `graph` is borrowed as mutable already.
#[allow(clippy::assigning_clones)]
Comment on lines +751 to +752
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if node.out_set != node.in_set {
graph.node_weight_mut(node_id).unwrap().0.out_set =
graph[node_id].0.in_set.clone();
Expand Down
2 changes: 1 addition & 1 deletion src/rust/engine/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "1.77.0"
channel = "1.78.0"
# NB: We don't list the components (namely `clippy` and `rustfmt`) and instead rely on either the
# the profile being "default" (by-and-large the default profile) or the nice error message from
# `cargo fmt` and `cargo clippy` if the required component isn't installed
Expand Down
1 change: 0 additions & 1 deletion src/rust/engine/src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ impl<'x> Params {
}
}

///
pub fn display_sorted_in_parens<T>(items: T) -> String
where
T: Iterator,
Expand Down
Loading