Skip to content

Commit 9a27f09

Browse files
authored
Merge pull request #513 from stepchowfun/rust-v1.88.0
Update Rust to v1.88.0
2 parents bb2f604 + 3658970 commit 9a27f09

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ jobs:
9090
# https://github.com/rust-lang/rustup/issues/2441
9191
#
9292
# for more information.
93-
rustup toolchain install 1.87.0 --no-self-update # [ref:rust_1.87.0]
94-
rustup default 1.87.0 # [ref:rust_1.87.0]
93+
rustup toolchain install 1.88.0 --no-self-update # [ref:rust_1.88.0]
94+
rustup default 1.88.0 # [ref:rust_1.88.0]
9595
9696
# Add the targets.
9797
rustup target add x86_64-pc-windows-msvc
@@ -131,8 +131,8 @@ jobs:
131131
set -euxo pipefail
132132
133133
# Install the appropriate version of Rust.
134-
rustup toolchain install 1.87.0 # [ref:rust_1.87.0]
135-
rustup default 1.87.0 # [ref:rust_1.87.0]
134+
rustup toolchain install 1.88.0 # [ref:rust_1.88.0]
135+
rustup default 1.88.0 # [ref:rust_1.88.0]
136136
137137
# Add the targets.
138138
rustup target add x86_64-apple-darwin
@@ -207,8 +207,8 @@ jobs:
207207
set -euxo pipefail
208208
209209
# Install the appropriate version of Rust.
210-
rustup toolchain install 1.87.0 # [ref:rust_1.87.0]
211-
rustup default 1.87.0 # [ref:rust_1.87.0]
210+
rustup toolchain install 1.88.0 # [ref:rust_1.88.0]
211+
rustup default 1.88.0 # [ref:rust_1.88.0]
212212
213213
# Fetch the program version.
214214
VERSION="$(cargo pkgid | cut -d# -f2 | cut -d: -f2)"

src/generate_rust.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ pub fn generate(
140140
use std::{{
141141
cmp::min,
142142
io::{{self, BufRead, Error, ErrorKind, Write}},
143-
mem::transmute,
144143
}};
145144
146145
const MISSING_FIELDS_ERROR_MESSAGE: &str = \"Struct missing one or more required field(s).\";
@@ -156,11 +155,11 @@ pub trait Deserialize: Sized {{
156155
}}
157156
158157
fn zigzag_encode(value: i64) -> u64 {{
159-
unsafe {{ transmute::<i64, u64>(value >> 63_u32) ^ transmute::<i64, u64>(value << 1_u32) }}
158+
i64::cast_unsigned(value >> 63_u32) ^ i64::cast_unsigned(value << 1_u32)
160159
}}
161160
162161
fn zigzag_decode(value: u64) -> i64 {{
163-
unsafe {{ transmute::<u64, i64>(value >> 1_u32) ^ -transmute::<u64, i64>(value & 1) }}
162+
u64::cast_signed(value >> 1_u32) ^ -u64::cast_signed(value & 1)
164163
}}
165164
166165
fn varint_size_from_value(value: u64) -> usize {{

test_data/types.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
use std::{
55
cmp::min,
66
io::{self, BufRead, Error, ErrorKind, Write},
7-
mem::transmute,
87
};
98

109
const MISSING_FIELDS_ERROR_MESSAGE: &str = "Struct missing one or more required field(s).";
@@ -20,11 +19,11 @@ pub trait Deserialize: Sized {
2019
}
2120

2221
fn zigzag_encode(value: i64) -> u64 {
23-
unsafe { transmute::<i64, u64>(value >> 63_u32) ^ transmute::<i64, u64>(value << 1_u32) }
22+
i64::cast_unsigned(value >> 63_u32) ^ i64::cast_unsigned(value << 1_u32)
2423
}
2524

2625
fn zigzag_decode(value: u64) -> i64 {
27-
unsafe { transmute::<u64, i64>(value >> 1_u32) ^ -transmute::<u64, i64>(value & 1) }
26+
u64::cast_signed(value >> 1_u32) ^ -u64::cast_signed(value & 1)
2827
}
2928

3029
fn varint_size_from_value(value: u64) -> usize {

toast.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ command_prefix: |
1717
cargo-offline () { cargo --frozen --offline "$@"; }
1818
1919
# Use this wrapper for formatting code or checking that code is formatted. We use a nightly Rust
20-
# version for the `trailing_comma` formatting option [tag:rust_fmt_nightly_2025-05-17]. The
20+
# version for the `trailing_comma` formatting option [tag:rust_fmt_nightly_2025-07-06]. The
2121
# nightly version was chosen as the latest available release with all components present
2222
# according to this page:
2323
# https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu.html
24-
cargo-fmt () { cargo +nightly-2025-05-17 --frozen --offline fmt --all -- "$@"; }
24+
cargo-fmt () { cargo +nightly-2025-07-06 --frozen --offline fmt --all -- "$@"; }
2525
2626
# Load the NVM startup file, if it exists.
2727
if [ -f "$HOME/.nvm/nvm.sh" ]; then
@@ -75,18 +75,18 @@ tasks:
7575
- install_packages
7676
- create_user
7777
command: |
78-
# Install stable Rust [tag:rust_1.87.0].
78+
# Install stable Rust [tag:rust_1.88.0].
7979
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
8080
-y \
81-
--default-toolchain 1.87.0 \
81+
--default-toolchain 1.88.0 \
8282
--profile minimal \
8383
--component clippy
8484
8585
# Add Rust tools to `$PATH`.
8686
. "$HOME/.cargo/env"
8787
88-
# Install nightly Rust [ref:rust_fmt_nightly_2025-05-17].
89-
rustup toolchain install nightly-2025-05-17 --profile minimal --component rustfmt
88+
# Install nightly Rust [ref:rust_fmt_nightly_2025-07-06].
89+
rustup toolchain install nightly-2025-07-06 --profile minimal --component rustfmt
9090
9191
install_node:
9292
description: Install Node.js, a JavaScript runtime environment.

0 commit comments

Comments
 (0)