From 9ae73a7d6cf246af1363896c7c2d38ee4f477889 Mon Sep 17 00:00:00 2001 From: Jon C Date: Mon, 31 Aug 2026 12:18:52 +0200 Subject: [PATCH 1/3] Bump nightly toolchain used by the repo #### Problem This repo is using an old nightly Rust toolchain, which is inconsistent with the others. #### Summary of changes Bump the toolchain, fix issues that come up. --- Makefile | 2 +- list-view/src/list_view.rs | 8 ++++---- list-view/src/list_view_mut.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 15fcf6b1..c1c3c6ad 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -RUST_TOOLCHAIN_NIGHTLY = nightly-2025-02-16 +RUST_TOOLCHAIN_NIGHTLY = nightly-2026-01-22 SOLANA_CLI_VERSION = 2.3.4 nightly = +${RUST_TOOLCHAIN_NIGHTLY} diff --git a/list-view/src/list_view.rs b/list-view/src/list_view.rs index 0c811517..d88ef084 100644 --- a/list-view/src/list_view.rs +++ b/list-view/src/list_view.rs @@ -57,7 +57,7 @@ impl ListView { } /// Unpack a read-only buffer into a `ListViewReadOnly` - pub fn unpack(buf: &[u8]) -> Result, ProgramError> { + pub fn unpack(buf: &[u8]) -> Result, ProgramError> { let layout = Self::calculate_layout(buf.len())?; // Slice the buffer to get the length prefix and the data. @@ -87,7 +87,7 @@ impl ListView { } /// Unpack the mutable buffer into a mutable `ListViewMut` - pub fn unpack_mut(buf: &mut [u8]) -> Result, ProgramError> { + pub fn unpack_mut(buf: &mut [u8]) -> Result, ProgramError> { let view = Self::build_mut_view(buf)?; if (*view.length).into() > view.capacity { return Err(ListViewError::BufferTooSmall.into()); @@ -96,7 +96,7 @@ impl ListView { } /// Initialize a buffer: sets `length = 0` and returns a mutable `ListViewMut`. - pub fn init(buf: &mut [u8]) -> Result, ProgramError> { + pub fn init(buf: &mut [u8]) -> Result, ProgramError> { let view = Self::build_mut_view(buf)?; *view.length = L::try_from(0usize).map_err(ListViewError::from)?; Ok(view) @@ -104,7 +104,7 @@ impl ListView { /// Internal helper to build a mutable view without validation or initialization. #[inline] - fn build_mut_view(buf: &mut [u8]) -> Result, ProgramError> { + fn build_mut_view(buf: &mut [u8]) -> Result, ProgramError> { let layout = Self::calculate_layout(buf.len())?; // Split the buffer to get the length prefix and the data. diff --git a/list-view/src/list_view_mut.rs b/list-view/src/list_view_mut.rs index ba201711..d64f7dcb 100644 --- a/list-view/src/list_view_mut.rs +++ b/list-view/src/list_view_mut.rs @@ -107,7 +107,7 @@ mod tests { fn init_view_mut( buffer: &mut Vec, capacity: usize, - ) -> ListViewMut { + ) -> ListViewMut<'_, T, L> { let size = ListView::::size_of(capacity).unwrap(); buffer.resize(size, 0); ListView::::init(buffer).unwrap() From e7a143583c8b096ef2f11d18ceda1ae59229cb76 Mon Sep 17 00:00:00 2001 From: Jon C Date: Mon, 31 Aug 2026 12:24:38 +0200 Subject: [PATCH 2/3] Add more lifetime annotations --- pod/src/list/list_view.rs | 8 ++++---- pod/src/list/list_view_mut.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pod/src/list/list_view.rs b/pod/src/list/list_view.rs index bbbbbcbb..c94f1eea 100644 --- a/pod/src/list/list_view.rs +++ b/pod/src/list/list_view.rs @@ -61,7 +61,7 @@ impl ListView { } /// Unpack a read-only buffer into a `ListViewReadOnly` - pub fn unpack(buf: &[u8]) -> Result, ProgramError> { + pub fn unpack(buf: &[u8]) -> Result, ProgramError> { let layout = Self::calculate_layout(buf.len())?; // Slice the buffer to get the length prefix and the data. @@ -90,7 +90,7 @@ impl ListView { } /// Unpack the mutable buffer into a mutable `ListViewMut` - pub fn unpack_mut(buf: &mut [u8]) -> Result, ProgramError> { + pub fn unpack_mut(buf: &mut [u8]) -> Result, ProgramError> { let view = Self::build_mut_view(buf)?; if (*view.length).into() > view.capacity { return Err(PodSliceError::BufferTooSmall.into()); @@ -100,7 +100,7 @@ impl ListView { /// Internal helper to build a mutable view without validation or initialization. #[inline] - fn build_mut_view(buf: &mut [u8]) -> Result, ProgramError> { + fn build_mut_view(buf: &mut [u8]) -> Result, ProgramError> { let layout = Self::calculate_layout(buf.len())?; // Split the buffer to get the length prefix and the data. @@ -180,7 +180,7 @@ where PodSliceError: From<>::Error>, { /// Initialize a buffer: sets `length = 0` and returns a mutable `ListViewMut`. - pub fn init(buf: &mut [u8]) -> Result, ProgramError> { + pub fn init(buf: &mut [u8]) -> Result, ProgramError> { let view = Self::build_mut_view(buf)?; *view.length = L::try_from(0).map_err(PodSliceError::from)?; Ok(view) diff --git a/pod/src/list/list_view_mut.rs b/pod/src/list/list_view_mut.rs index bb0993e1..f26ccecc 100644 --- a/pod/src/list/list_view_mut.rs +++ b/pod/src/list/list_view_mut.rs @@ -114,7 +114,7 @@ mod tests { fn init_view_mut( buffer: &mut Vec, capacity: usize, - ) -> ListViewMut + ) -> ListViewMut<'_, T, L> where PodSliceError: From<>::Error>, { From c2872e80c40ffc089a8b81007bf19678ed21f48f Mon Sep 17 00:00:00 2001 From: Jon C Date: Mon, 31 Aug 2026 12:25:19 +0200 Subject: [PATCH 3/3] Also bump toolchain in workspace Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 521897b1..a5a76fcd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ solana = "2.3.4" # Specify Rust toolchains for rustfmt, clippy, and build. # Any unprovided toolchains default to stable. [workspace.metadata.toolchains] -nightly = "nightly-2025-02-16" +nightly = "nightly-2026-01-22" [workspace.metadata.spellcheck] config = "scripts/spellcheck.toml"