Skip to content

Commit 4264909

Browse files
authored
chore: Bump MSRV to 1.93 (#1594)
Also, clean up the parts that became more readable thanks to the newly stabilized `std::fmt::from_fn`.
1 parent c92e941 commit 4264909

10 files changed

Lines changed: 31 additions & 41 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
container:
2626
- 'ubuntu:24.04'
2727
- 'opensuse/tumbleweed:latest'
28-
- 'rust:1.92-alpine'
28+
- 'rust:1.93-alpine'
2929
test-qemu:
3030
- false
3131
test-plugins:
@@ -46,7 +46,7 @@ jobs:
4646
test-qemu: false
4747
exclude: # TODO: https://github.com/actions/runner/issues/1637
4848
- runs-on: ubuntu-24.04-arm
49-
container: 'rust:1.92-alpine'
49+
container: 'rust:1.93-alpine'
5050
fail-fast: false
5151

5252
runs-on: ${{ matrix.runs-on }}
@@ -112,7 +112,7 @@ jobs:
112112
persist-credentials: false
113113
# This is where we check that we're not using features from a more recent rust version. When
114114
# updating this, please also update workspace.package.rust-version in `Cargo.toml`.
115-
- uses: dtolnay/rust-toolchain@1.92.0
115+
- uses: dtolnay/rust-toolchain@1.93.0
116116
id: rust-toolchain
117117
with:
118118
components: clippy

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repository = "https://github.com/davidlattimore/wild"
1515
license = "MIT OR Apache-2.0"
1616
version = "0.8.0"
1717
readme = "README.md"
18-
rust-version = "1.92"
18+
rust-version = "1.93"
1919
edition = "2024"
2020

2121
# Note, the versions listed here are minimum supported versions and should only be increased when

docker/alpine.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# docker build --progress=plain -t wild-dev-alpine . -f docker/alpine.Dockerfile
44
# docker run -it wild-dev-alpine
55

6-
FROM rust:1.92-alpine AS chef
6+
FROM rust:1.93-alpine AS chef
77
RUN wget -qO- https://github.com/LukeMathWalker/cargo-chef/releases/download/v0.1.70/cargo-chef-x86_64-unknown-linux-musl.tar.gz | tar -xzf- && \
88
mv cargo-chef /usr/local/bin
99
RUN rustup toolchain install nightly && \

docker/arch.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ RUN wget -qO- https://github.com/LukeMathWalker/cargo-chef/releases/download/v0.
4646

4747
RUN wget https://sh.rustup.rs -O rustup-installer && \
4848
chmod +x rustup-installer && \
49-
./rustup-installer -y --default-toolchain 1.92.0
49+
./rustup-installer -y --default-toolchain 1.93.0
5050

5151
ENV PATH="/root/.cargo/bin:$PATH"
5252

docker/debian.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# docker build --progress=plain -t wild-dev-debian . -f docker/debian.Dockerfile
44
# docker run -it wild-dev-debian
55

6-
FROM rust:1.92 AS chef
6+
FROM rust:1.93 AS chef
77
RUN apt-get update && \
88
apt-get install -y \
99
clang \

docker/ubuntu-24.04.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RUN apt-get update && \
3131

3232
RUN wget https://sh.rustup.rs -O rustup-installer && \
3333
chmod +x rustup-installer && \
34-
./rustup-installer -y --default-toolchain 1.92.0
34+
./rustup-installer -y --default-toolchain 1.93.0
3535

3636
ENV PATH="/root/.cargo/bin:$PATH"
3737

flake.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libwild/src/grouping.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,15 @@ pub(crate) fn create_groups<'data, O: ObjectFile<'data>>(
176176
symbol_db.add_group(Group::LinkerScripts(linker_scripts));
177177
}
178178

179-
tracing::trace!("GROUPS:\n{}", GroupsDisplay(&symbol_db.groups));
179+
tracing::trace!(
180+
"GROUPS:\n{}",
181+
std::fmt::from_fn(|f| {
182+
for (i, group) in symbol_db.groups.iter().enumerate() {
183+
writeln!(f, "{i}: {group}")?;
184+
}
185+
Ok(())
186+
})
187+
);
180188
}
181189

182190
/// Decides after how many symbols, we should start a new group.
@@ -223,8 +231,6 @@ fn count_symbols<'data, O: ObjectFile<'data>>(
223231
objects.iter().map(|o| o.num_symbols()).sum::<usize>()
224232
}
225233

226-
struct GroupsDisplay<'a, 'data, O: ObjectFile<'data>>(&'a [Group<'data, O>]);
227-
228234
impl<'data, O: ObjectFile<'data>> SequencedInputObject<'data, O> {
229235
pub(crate) fn symbol_name(
230236
&self,
@@ -289,15 +295,6 @@ impl<'db, 'data, O: ObjectFile<'data>> SequencedInput<'db, 'data, O> {
289295
}
290296
}
291297

292-
impl<'data, O: ObjectFile<'data>> Display for GroupsDisplay<'_, 'data, O> {
293-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
294-
for (i, group) in self.0.iter().enumerate() {
295-
writeln!(f, "{i}: {group}")?;
296-
}
297-
Ok(())
298-
}
299-
}
300-
301298
impl<'data, O: ObjectFile<'data>> std::fmt::Display for SequencedInputObject<'data, O> {
302299
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
303300
std::fmt::Display::fmt(&self.parsed.input, f)

libwild/src/layout.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6178,25 +6178,18 @@ impl std::fmt::Debug for FileLayoutState<'_> {
61786178
}
61796179
}
61806180

6181-
fn section_debug(object: &crate::elf::File, section_index: object::SectionIndex) -> SectionDebug {
6181+
fn section_debug(
6182+
object: &crate::elf::File,
6183+
section_index: object::SectionIndex,
6184+
) -> impl std::fmt::Display {
61826185
let name = object
61836186
.section(section_index)
61846187
.and_then(|section| object.section_name(section))
61856188
.map_or_else(
61866189
|_| "??".to_owned(),
61876190
|name| String::from_utf8_lossy(name).into_owned(),
61886191
);
6189-
SectionDebug { name }
6190-
}
6191-
6192-
struct SectionDebug {
6193-
name: String,
6194-
}
6195-
6196-
impl Display for SectionDebug {
6197-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6198-
write!(f, "`{}`", self.name)
6199-
}
6192+
std::fmt::from_fn(move |f| write!(f, "`{name}`"))
62006193
}
62016194

62026195
impl<'data> DynamicSymbolDefinition<'data> {

nix/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
glibc,
1313
stdenv,
1414
}:
15-
assert lib.assertMsg (lib.versionAtLeast rustc.version "1.92.0")
16-
"Wild requires at least Rust 1.92.0, this instance of nixpkgs has Rust ${rustc.version}";
15+
assert lib.assertMsg (lib.versionAtLeast rustc.version "1.93.0")
16+
"Wild requires at least Rust 1.93.0, this instance of nixpkgs has Rust ${rustc.version}";
1717

1818
let
1919
cargoToml = builtins.fromTOML (builtins.readFile ../Cargo.toml);

0 commit comments

Comments
 (0)